commit stringlengths 40 40 | old_file stringlengths 4 184 | new_file stringlengths 4 184 | old_contents stringlengths 1 3.6k | new_contents stringlengths 5 3.38k | subject stringlengths 15 778 | message stringlengths 16 6.74k | lang stringclasses 201 values | license stringclasses 13 values | repos stringlengths 6 116k | config stringclasses 201 values | content stringlengths 137 7.24k | diff stringlengths 26 5.55k | diff_length int64 1 123 | relative_diff_length float64 0.01 89 | n_lines_added int64 0 108 | n_lines_deleted int64 0 106 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4026ee18f512d445a57413b65b7a29f965ededf4 | domino/utils/jupyter.py | domino/utils/jupyter.py |
# Add parent folder to path and change dir to it
# so that we can access easily to all code and data in that folder
import sys
import os
import os.path
def notebook_init():
"""
Assuming a project is built in a root folder
with a notebooks subfolder where all .ipynb files are located,
run this function as the first cell in a notebook
to make it think the current folder is the project folder,
so all subfolders of the root folder are accessible directly.
Also, any imports inside the root folder will be accessible too.
"""
if os.path.split(os.path.abspath(os.path.curdir))[-1] == 'notebooks':
sys.path.append(os.path.abspath(os.path.pardir))
os.chdir(os.path.pardir) |
# Add parent folder to path and change dir to it
# so that we can access easily to all code and data in that folder
import sys
import os
import os.path
def notebook_init(path=os.path.pardir):
"""
Assuming a project is built in a root folder
with a notebooks subfolder where all .ipynb files are located,
run this function as the first cell in a notebook
to make it think the current folder is the project folder,
so all subfolders of the root folder are accessible directly.
Also, any imports inside the root folder will be accessible too.
"""
if os.path.split(os.path.abspath(os.path.curdir))[-1] == 'notebooks':
sys.path.append(os.path.abspath(path))
os.chdir(path) | Add path parameter to notebook_init() | Add path parameter to notebook_init()
| Python | mit | aparafita/domino | python | ## Code Before:
# Add parent folder to path and change dir to it
# so that we can access easily to all code and data in that folder
import sys
import os
import os.path
def notebook_init():
"""
Assuming a project is built in a root folder
with a notebooks subfolder where all .ipynb files are located,
run this function as the first cell in a notebook
to make it think the current folder is the project folder,
so all subfolders of the root folder are accessible directly.
Also, any imports inside the root folder will be accessible too.
"""
if os.path.split(os.path.abspath(os.path.curdir))[-1] == 'notebooks':
sys.path.append(os.path.abspath(os.path.pardir))
os.chdir(os.path.pardir)
## Instruction:
Add path parameter to notebook_init()
## Code After:
# Add parent folder to path and change dir to it
# so that we can access easily to all code and data in that folder
import sys
import os
import os.path
def notebook_init(path=os.path.pardir):
"""
Assuming a project is built in a root folder
with a notebooks subfolder where all .ipynb files are located,
run this function as the first cell in a notebook
to make it think the current folder is the project folder,
so all subfolders of the root folder are accessible directly.
Also, any imports inside the root folder will be accessible too.
"""
if os.path.split(os.path.abspath(os.path.curdir))[-1] == 'notebooks':
sys.path.append(os.path.abspath(path))
os.chdir(path) |
# Add parent folder to path and change dir to it
# so that we can access easily to all code and data in that folder
import sys
import os
import os.path
- def notebook_init():
+ def notebook_init(path=os.path.pardir):
"""
Assuming a project is built in a root folder
with a notebooks subfolder where all .ipynb files are located,
run this function as the first cell in a notebook
to make it think the current folder is the project folder,
so all subfolders of the root folder are accessible directly.
Also, any imports inside the root folder will be accessible too.
"""
if os.path.split(os.path.abspath(os.path.curdir))[-1] == 'notebooks':
- sys.path.append(os.path.abspath(os.path.pardir))
? --- -------
+ sys.path.append(os.path.abspath(path))
- os.chdir(os.path.pardir)
? --- -------
+ os.chdir(path) | 6 | 0.26087 | 3 | 3 |
461f7517a303b9d65f983b9de0405c12122cb764 | lib/cpp_samples.rb | lib/cpp_samples.rb | require 'pp'
require 'cpp_samples/version'
module CppSamples
Section = Struct.new(:path, :title)
SAMPLES_DIR = './samples'
def self.generate
pp build_samples_tree(SAMPLES_DIR)
end
def self.build_samples_tree(samples_dir)
sections = build_dir(samples_dir)
sections.inject({}) do |tree, section|
categories = build_dir(section.path)
tree[section] = categories.inject({}) do |tree_section, category|
tree_section[category] = []
tree_section
end
tree
end
end
def self.build_dir(dir)
subdir_title_file_names = Dir.glob("#{dir}/*/TITLE")
subdir_title_file_names.inject([]) do |sections, subdir_title_file_name|
subdir_path = File.dirname(subdir_title_file_name)
subdir_title_file = File.new(subdir_title_file_name, 'r')
subdir_title = subdir_title_file.readline
sections << Section.new(subdir_path, subdir_title)
end
end
end
| require 'pp'
require 'cpp_samples/version'
module CppSamples
Section = Struct.new(:path, :title)
SAMPLES_DIR = './samples'
def self.generate
pp build_samples_tree(SAMPLES_DIR)
end
def self.build_samples_tree(samples_dir)
sections = build_dir(samples_dir)
sections.inject({}) do |tree, section|
categories = build_dir(section.path)
tree[section] = categories.inject({}) do |tree_section, category|
tree_section[category] = collect_samples(category.path)
tree_section
end
tree
end
end
def self.build_dir(dir)
subdir_title_file_names = Dir.glob("#{dir}/*/TITLE")
subdir_title_file_names.inject([]) do |sections, subdir_title_file_name|
subdir_path = File.dirname(subdir_title_file_name)
subdir_title_file = File.new(subdir_title_file_name, 'r')
subdir_title = subdir_title_file.readline
sections << Section.new(subdir_path, subdir_title)
end
end
def self.collect_samples(dir)
sample_file_names = Dir.glob("#{dir}/*.cpp")
return sample_file_names
end
end
| Add function to collect samples | Add function to collect samples
| Ruby | mit | sftrabbit/CppSamples-Web,sftrabbit/CppSamples-Web,sftrabbit/CppSamples,sftrabbit/CppSamples-Web,sftrabbit/CppSamples,sftrabbit/CppSamples | ruby | ## Code Before:
require 'pp'
require 'cpp_samples/version'
module CppSamples
Section = Struct.new(:path, :title)
SAMPLES_DIR = './samples'
def self.generate
pp build_samples_tree(SAMPLES_DIR)
end
def self.build_samples_tree(samples_dir)
sections = build_dir(samples_dir)
sections.inject({}) do |tree, section|
categories = build_dir(section.path)
tree[section] = categories.inject({}) do |tree_section, category|
tree_section[category] = []
tree_section
end
tree
end
end
def self.build_dir(dir)
subdir_title_file_names = Dir.glob("#{dir}/*/TITLE")
subdir_title_file_names.inject([]) do |sections, subdir_title_file_name|
subdir_path = File.dirname(subdir_title_file_name)
subdir_title_file = File.new(subdir_title_file_name, 'r')
subdir_title = subdir_title_file.readline
sections << Section.new(subdir_path, subdir_title)
end
end
end
## Instruction:
Add function to collect samples
## Code After:
require 'pp'
require 'cpp_samples/version'
module CppSamples
Section = Struct.new(:path, :title)
SAMPLES_DIR = './samples'
def self.generate
pp build_samples_tree(SAMPLES_DIR)
end
def self.build_samples_tree(samples_dir)
sections = build_dir(samples_dir)
sections.inject({}) do |tree, section|
categories = build_dir(section.path)
tree[section] = categories.inject({}) do |tree_section, category|
tree_section[category] = collect_samples(category.path)
tree_section
end
tree
end
end
def self.build_dir(dir)
subdir_title_file_names = Dir.glob("#{dir}/*/TITLE")
subdir_title_file_names.inject([]) do |sections, subdir_title_file_name|
subdir_path = File.dirname(subdir_title_file_name)
subdir_title_file = File.new(subdir_title_file_name, 'r')
subdir_title = subdir_title_file.readline
sections << Section.new(subdir_path, subdir_title)
end
end
def self.collect_samples(dir)
sample_file_names = Dir.glob("#{dir}/*.cpp")
return sample_file_names
end
end
| require 'pp'
require 'cpp_samples/version'
module CppSamples
Section = Struct.new(:path, :title)
SAMPLES_DIR = './samples'
def self.generate
pp build_samples_tree(SAMPLES_DIR)
end
def self.build_samples_tree(samples_dir)
sections = build_dir(samples_dir)
sections.inject({}) do |tree, section|
categories = build_dir(section.path)
tree[section] = categories.inject({}) do |tree_section, category|
- tree_section[category] = []
+ tree_section[category] = collect_samples(category.path)
tree_section
end
tree
end
end
def self.build_dir(dir)
subdir_title_file_names = Dir.glob("#{dir}/*/TITLE")
subdir_title_file_names.inject([]) do |sections, subdir_title_file_name|
subdir_path = File.dirname(subdir_title_file_name)
subdir_title_file = File.new(subdir_title_file_name, 'r')
subdir_title = subdir_title_file.readline
sections << Section.new(subdir_path, subdir_title)
end
end
+
+ def self.collect_samples(dir)
+ sample_file_names = Dir.glob("#{dir}/*.cpp")
+ return sample_file_names
+ end
end | 7 | 0.170732 | 6 | 1 |
600dd507661d81eb7157175b8d03260e2fc9085e | .travis.yml | .travis.yml | sudo: false
language: cpp
matrix:
include:
- compiler: gcc
env: COMPILER=g++-4.7
addons: {apt: {packages: [g++-4.7], sources: [ubuntu-toolchain-r-test]}}
- compiler: gcc
env: COMPILER=g++-4.8
addons: {apt: {packages: [g++-4.8], sources: [ubuntu-toolchain-r-test]}}
- compiler: gcc
env: COMPILER=g++-4.9
addons: {apt: {packages: [g++-4.9], sources: [ubuntu-toolchain-r-test]}}
- compiler: gcc
env: COMPILER=g++-5
addons: {apt: {packages: [g++-5], sources: [ubuntu-toolchain-r-test]}}
- compiler: clang
env: COMPILER=clang++
addons: {apt: {packages: [g++-4.7], sources: [ubuntu-toolchain-r-test]}}
- compiler: clang
env: COMPILER=clang++-3.5
addons: {apt: {packages: [clang-3.5], sources: [ubuntu-toolchain-r-test,llvm-toolchain-precise-3.5]}}
- compiler: clang
env: COMPILER=clang++-3.6
addons: {apt: {packages: [clang-3.6], sources: [ubuntu-toolchain-r-test,llvm-toolchain-precise-3.6]}}
script:
- CXX=$COMPILER make -C src full
| sudo: false
language: cpp
matrix:
include:
- compiler: gcc
env: COMPILER=g++-4.7
addons: {apt: {packages: [g++-4.7], sources: [ubuntu-toolchain-r-test]}}
- compiler: gcc
env: COMPILER=g++-4.8
addons: {apt: {packages: [g++-4.8], sources: [ubuntu-toolchain-r-test]}}
- compiler: gcc
env: COMPILER=g++-4.9
addons: {apt: {packages: [g++-4.9], sources: [ubuntu-toolchain-r-test]}}
- compiler: gcc
env: COMPILER=g++-5
addons: {apt: {packages: [g++-5], sources: [ubuntu-toolchain-r-test]}}
- compiler: clang
env: COMPILER=clang++
addons: {apt: {packages: [g++-4.7], sources: [ubuntu-toolchain-r-test]}}
- compiler: clang
env: COMPILER=clang++-3.5
addons: {apt: {packages: [clang-3.5], sources: [ubuntu-toolchain-r-test,llvm-toolchain-precise-3.5]}}
- compiler: clang
env: COMPILER=clang++-3.6
addons: {apt: {packages: [clang-3.6], sources: [ubuntu-toolchain-r-test,llvm-toolchain-precise-3.6]}}
script:
- CXX=$COMPILER make -C src full
- CXX=$COMPILER make -C tests parsito_bundle
| Add parsito_bundle test to Travis CI. | Add parsito_bundle test to Travis CI.
| YAML | mpl-2.0 | ufal/parsito,ufal/parsito,ufal/parsito,ufal/parsito,ufal/parsito,ufal/parsito,ufal/parsito,ufal/parsito | yaml | ## Code Before:
sudo: false
language: cpp
matrix:
include:
- compiler: gcc
env: COMPILER=g++-4.7
addons: {apt: {packages: [g++-4.7], sources: [ubuntu-toolchain-r-test]}}
- compiler: gcc
env: COMPILER=g++-4.8
addons: {apt: {packages: [g++-4.8], sources: [ubuntu-toolchain-r-test]}}
- compiler: gcc
env: COMPILER=g++-4.9
addons: {apt: {packages: [g++-4.9], sources: [ubuntu-toolchain-r-test]}}
- compiler: gcc
env: COMPILER=g++-5
addons: {apt: {packages: [g++-5], sources: [ubuntu-toolchain-r-test]}}
- compiler: clang
env: COMPILER=clang++
addons: {apt: {packages: [g++-4.7], sources: [ubuntu-toolchain-r-test]}}
- compiler: clang
env: COMPILER=clang++-3.5
addons: {apt: {packages: [clang-3.5], sources: [ubuntu-toolchain-r-test,llvm-toolchain-precise-3.5]}}
- compiler: clang
env: COMPILER=clang++-3.6
addons: {apt: {packages: [clang-3.6], sources: [ubuntu-toolchain-r-test,llvm-toolchain-precise-3.6]}}
script:
- CXX=$COMPILER make -C src full
## Instruction:
Add parsito_bundle test to Travis CI.
## Code After:
sudo: false
language: cpp
matrix:
include:
- compiler: gcc
env: COMPILER=g++-4.7
addons: {apt: {packages: [g++-4.7], sources: [ubuntu-toolchain-r-test]}}
- compiler: gcc
env: COMPILER=g++-4.8
addons: {apt: {packages: [g++-4.8], sources: [ubuntu-toolchain-r-test]}}
- compiler: gcc
env: COMPILER=g++-4.9
addons: {apt: {packages: [g++-4.9], sources: [ubuntu-toolchain-r-test]}}
- compiler: gcc
env: COMPILER=g++-5
addons: {apt: {packages: [g++-5], sources: [ubuntu-toolchain-r-test]}}
- compiler: clang
env: COMPILER=clang++
addons: {apt: {packages: [g++-4.7], sources: [ubuntu-toolchain-r-test]}}
- compiler: clang
env: COMPILER=clang++-3.5
addons: {apt: {packages: [clang-3.5], sources: [ubuntu-toolchain-r-test,llvm-toolchain-precise-3.5]}}
- compiler: clang
env: COMPILER=clang++-3.6
addons: {apt: {packages: [clang-3.6], sources: [ubuntu-toolchain-r-test,llvm-toolchain-precise-3.6]}}
script:
- CXX=$COMPILER make -C src full
- CXX=$COMPILER make -C tests parsito_bundle
| sudo: false
language: cpp
matrix:
include:
- compiler: gcc
env: COMPILER=g++-4.7
addons: {apt: {packages: [g++-4.7], sources: [ubuntu-toolchain-r-test]}}
- compiler: gcc
env: COMPILER=g++-4.8
addons: {apt: {packages: [g++-4.8], sources: [ubuntu-toolchain-r-test]}}
- compiler: gcc
env: COMPILER=g++-4.9
addons: {apt: {packages: [g++-4.9], sources: [ubuntu-toolchain-r-test]}}
- compiler: gcc
env: COMPILER=g++-5
addons: {apt: {packages: [g++-5], sources: [ubuntu-toolchain-r-test]}}
- compiler: clang
env: COMPILER=clang++
addons: {apt: {packages: [g++-4.7], sources: [ubuntu-toolchain-r-test]}}
- compiler: clang
env: COMPILER=clang++-3.5
addons: {apt: {packages: [clang-3.5], sources: [ubuntu-toolchain-r-test,llvm-toolchain-precise-3.5]}}
- compiler: clang
env: COMPILER=clang++-3.6
addons: {apt: {packages: [clang-3.6], sources: [ubuntu-toolchain-r-test,llvm-toolchain-precise-3.6]}}
script:
- CXX=$COMPILER make -C src full
+ - CXX=$COMPILER make -C tests parsito_bundle | 1 | 0.037037 | 1 | 0 |
2912670883355f9cc9d01f3348af9a6920494171 | README.md | README.md |
My dotfiles are managed with [rcm](https://github.com/thoughtbot/rcm). The [thoughtbot](https://thoughtbot.com/) blog post for `rcm` is [here](https://robots.thoughtbot.com/rcm-for-rc-files-in-dotfiles-repos).
## Getting Started
### Get `rcm`
Instructions from the `rcm` [README](https://github.com/thoughtbot/rcm).
#### macOS
```sh
# install rcm
brew tap thoughtbot/formulae
brew install rcm
```
#### Ubuntu (Windows Subsystem for Linux)
```sh
sudo add-apt-repository ppa:martin-frost/thoughtbot-rcm
sudo apt-get update
sudo apt-get install rcm
```
### Get dotfiles
Now that I have `rcm`, clone my dotfiles.
```sh
git clone https://github.com/curtisalexander/dotfiles.git ~/code/dotfiles
```
### Setup dotfiles
<placeholder>
|
My dotfiles are managed with [rcm](https://github.com/thoughtbot/rcm). The [thoughtbot](https://thoughtbot.com/) blog post for `rcm` is [here](https://robots.thoughtbot.com/rcm-for-rc-files-in-dotfiles-repos).
## Getting Started
### Get `rcm`
Instructions from the `rcm` [README](https://github.com/thoughtbot/rcm).
#### macOS
```sh
# install rcm
brew tap thoughtbot/formulae
brew install rcm
```
#### Ubuntu (Windows Subsystem for Linux)
```sh
sudo add-apt-repository ppa:martin-frost/thoughtbot-rcm
sudo apt-get update
sudo apt-get install rcm
```
### Get dotfiles
Now that I have `rcm`, clone my dotfiles.
```sh
git clone https://github.com/curtisalexander/dotfiles.git ~/code/dotfiles
```
### Setup dotfiles
<placeholder>
### Add a new dotfile
<placeholder>
| Add a placeholder for how to add a new dotfile. | Add a placeholder for how to add a new dotfile.
| Markdown | mit | curtisalexander/dotfiles | markdown | ## Code Before:
My dotfiles are managed with [rcm](https://github.com/thoughtbot/rcm). The [thoughtbot](https://thoughtbot.com/) blog post for `rcm` is [here](https://robots.thoughtbot.com/rcm-for-rc-files-in-dotfiles-repos).
## Getting Started
### Get `rcm`
Instructions from the `rcm` [README](https://github.com/thoughtbot/rcm).
#### macOS
```sh
# install rcm
brew tap thoughtbot/formulae
brew install rcm
```
#### Ubuntu (Windows Subsystem for Linux)
```sh
sudo add-apt-repository ppa:martin-frost/thoughtbot-rcm
sudo apt-get update
sudo apt-get install rcm
```
### Get dotfiles
Now that I have `rcm`, clone my dotfiles.
```sh
git clone https://github.com/curtisalexander/dotfiles.git ~/code/dotfiles
```
### Setup dotfiles
<placeholder>
## Instruction:
Add a placeholder for how to add a new dotfile.
## Code After:
My dotfiles are managed with [rcm](https://github.com/thoughtbot/rcm). The [thoughtbot](https://thoughtbot.com/) blog post for `rcm` is [here](https://robots.thoughtbot.com/rcm-for-rc-files-in-dotfiles-repos).
## Getting Started
### Get `rcm`
Instructions from the `rcm` [README](https://github.com/thoughtbot/rcm).
#### macOS
```sh
# install rcm
brew tap thoughtbot/formulae
brew install rcm
```
#### Ubuntu (Windows Subsystem for Linux)
```sh
sudo add-apt-repository ppa:martin-frost/thoughtbot-rcm
sudo apt-get update
sudo apt-get install rcm
```
### Get dotfiles
Now that I have `rcm`, clone my dotfiles.
```sh
git clone https://github.com/curtisalexander/dotfiles.git ~/code/dotfiles
```
### Setup dotfiles
<placeholder>
### Add a new dotfile
<placeholder>
|
My dotfiles are managed with [rcm](https://github.com/thoughtbot/rcm). The [thoughtbot](https://thoughtbot.com/) blog post for `rcm` is [here](https://robots.thoughtbot.com/rcm-for-rc-files-in-dotfiles-repos).
## Getting Started
### Get `rcm`
Instructions from the `rcm` [README](https://github.com/thoughtbot/rcm).
#### macOS
```sh
# install rcm
brew tap thoughtbot/formulae
brew install rcm
```
#### Ubuntu (Windows Subsystem for Linux)
```sh
sudo add-apt-repository ppa:martin-frost/thoughtbot-rcm
sudo apt-get update
sudo apt-get install rcm
```
### Get dotfiles
Now that I have `rcm`, clone my dotfiles.
```sh
git clone https://github.com/curtisalexander/dotfiles.git ~/code/dotfiles
```
### Setup dotfiles
<placeholder>
+
+
+ ### Add a new dotfile
+
+ <placeholder> | 5 | 0.135135 | 5 | 0 |
6261c078f1b70798166afa6960e24a2669f5dcc0 | config/search.yml | config/search.yml | site_name: Mapzen Search
docs_dir: src/search
site_dir: dist/search
pages:
- Home: index.md
- 'Get started': 'get-started.md'
- 'Add search to a map': 'add-search-to-a-map.md'
- 'API keys and rate limits': 'api-keys-rate-limits.md'
- 'Search': 'search.md'
- 'Reverse geocoding': 'reverse.md'
- 'Autocomplete': 'autocomplete.md'
- 'Place': 'place.md'
- 'API responses': 'response.md'
- 'Data sources': 'data-sources.md'
- 'Load data from the browser': 'use-cors.md'
- 'Terminology': 'glossary.md'
- 'HTTP status codes': 'http-status-codes.md'
- 'Transition from Pelias beta': 'transition-from-beta.md'
extra:
site_subtitle: 'Find places and addresses with this geographic search service built on open tools and open data.'
#'High-performance geocoding and place search service'
project_repo_url: https://github.com/pelias/
docs_base_url: https://github.com/pelias/pelias-doc
| site_name: Mapzen Search
docs_dir: src/search
site_dir: dist/search
pages:
- Home: index.md
- 'Get started': 'get-started.md'
- 'Add search to a map': 'add-search-to-a-map.md'
- 'API keys and rate limits': 'api-keys-rate-limits.md'
- 'Search': 'search.md'
- 'Reverse geocoding': 'reverse.md'
- 'Autocomplete': 'autocomplete.md'
- 'Place': 'place.md'
- 'API responses': 'response.md'
- 'Data sources': 'data-sources.md'
- 'Load data from the browser': 'use-cors.md'
- 'Terminology': 'glossary.md'
- 'HTTP status codes': 'http-status-codes.md'
- 'Transition from Pelias beta': 'transition-from-beta.md'
extra:
site_subtitle: 'Find places and addresses with this geographic search service built on open tools and open data.'
#'High-performance geocoding and place search service'
project_repo_url: https://github.com/pelias/
docs_base_url: https://github.com/pelias/pelias-doc/blob/master
| Update to URL to master branch | Update to URL to master branch | YAML | mit | mapzen/documentation,mapzen/documentation,mapzen/mapzen-docs-generator,mapzen/mapzen-docs-generator,mapzen/mapzen-docs-generator,mapzen/documentation,mapzen/documentation,mapzen/mapzen-docs-generator | yaml | ## Code Before:
site_name: Mapzen Search
docs_dir: src/search
site_dir: dist/search
pages:
- Home: index.md
- 'Get started': 'get-started.md'
- 'Add search to a map': 'add-search-to-a-map.md'
- 'API keys and rate limits': 'api-keys-rate-limits.md'
- 'Search': 'search.md'
- 'Reverse geocoding': 'reverse.md'
- 'Autocomplete': 'autocomplete.md'
- 'Place': 'place.md'
- 'API responses': 'response.md'
- 'Data sources': 'data-sources.md'
- 'Load data from the browser': 'use-cors.md'
- 'Terminology': 'glossary.md'
- 'HTTP status codes': 'http-status-codes.md'
- 'Transition from Pelias beta': 'transition-from-beta.md'
extra:
site_subtitle: 'Find places and addresses with this geographic search service built on open tools and open data.'
#'High-performance geocoding and place search service'
project_repo_url: https://github.com/pelias/
docs_base_url: https://github.com/pelias/pelias-doc
## Instruction:
Update to URL to master branch
## Code After:
site_name: Mapzen Search
docs_dir: src/search
site_dir: dist/search
pages:
- Home: index.md
- 'Get started': 'get-started.md'
- 'Add search to a map': 'add-search-to-a-map.md'
- 'API keys and rate limits': 'api-keys-rate-limits.md'
- 'Search': 'search.md'
- 'Reverse geocoding': 'reverse.md'
- 'Autocomplete': 'autocomplete.md'
- 'Place': 'place.md'
- 'API responses': 'response.md'
- 'Data sources': 'data-sources.md'
- 'Load data from the browser': 'use-cors.md'
- 'Terminology': 'glossary.md'
- 'HTTP status codes': 'http-status-codes.md'
- 'Transition from Pelias beta': 'transition-from-beta.md'
extra:
site_subtitle: 'Find places and addresses with this geographic search service built on open tools and open data.'
#'High-performance geocoding and place search service'
project_repo_url: https://github.com/pelias/
docs_base_url: https://github.com/pelias/pelias-doc/blob/master
| site_name: Mapzen Search
docs_dir: src/search
site_dir: dist/search
pages:
- Home: index.md
- 'Get started': 'get-started.md'
- 'Add search to a map': 'add-search-to-a-map.md'
- 'API keys and rate limits': 'api-keys-rate-limits.md'
- 'Search': 'search.md'
- 'Reverse geocoding': 'reverse.md'
- 'Autocomplete': 'autocomplete.md'
- 'Place': 'place.md'
- 'API responses': 'response.md'
- 'Data sources': 'data-sources.md'
- 'Load data from the browser': 'use-cors.md'
- 'Terminology': 'glossary.md'
- 'HTTP status codes': 'http-status-codes.md'
- 'Transition from Pelias beta': 'transition-from-beta.md'
extra:
site_subtitle: 'Find places and addresses with this geographic search service built on open tools and open data.'
#'High-performance geocoding and place search service'
project_repo_url: https://github.com/pelias/
- docs_base_url: https://github.com/pelias/pelias-doc
+ docs_base_url: https://github.com/pelias/pelias-doc/blob/master
? ++++++++++++
| 2 | 0.08 | 1 | 1 |
33b66c09e3572e34876110b8dab4f01f4c2627f2 | README.md | README.md | fatherhood
==========
[](https://drone.io/github.com/aybabtme/fatherhood/latest)
Fatherhood is a JSON stream decoding library wrapping the [megajson](https://github.com/benbjohnson/megajson) scanner.
| fatherhood
==========
[](https://drone.io/github.com/aybabtme/fatherhood/latest)
fatherhood is a JSON stream decoding library wrapping the scanner of
[`megajson`](https://github.com/benbjohnson/megajson).
Why use this and not megajson?
==============================
megajson uses code generation to create decoders/encoders for your types.
fatherhood doesn't.
Some combinaisons of types aren't working in megajson. They work with
fatherhood. For instance, I wrote fatherhood because megajson didn't
Why use megajson and not this?
==============================
megajson offers an encoder, fatherhood only decodes.
Aside for the code generation thing, megajson gives you drop in codecs.
Meanwhile, fatherhood's API is fugly and a pain to use.
Performance
===========
Speed is equivalent to [`megajson`](github.com/benbjohnson/megajson), since it
uses the same scanner. All kudos to [Ben Johnson](github.com/benbjohnson),
not me.
| package | ns/op | MB/s |
|:-------------:|:----------:|:-----:|
| megajson | 53'557'744 | 36.23 |
| fatherhood | 53'717'435 | 36.12 |
| encoding/json | 98'061'899 | 19.79 |
Benchmark from the following revisions:
* megajson, on `master`:
```
benbjohnson/megajson $ git rev-parse HEAD
533c329f8535e121708a0ee08ea53bda5edfbe79
```
* fatherhood, on `master`:
```
aybabtme/fatherhood $ git rev-parse HEAD
5cfd87c089e3829a28c9cfcd8993370bf787ffa1
```
* encoding/json, on `release-branch.go1.2`:
```
encoding/json $ hg summary
parent: 18712:0ddbdc3c7ce2 go1.2.1 release
go1.2.1
branch: release-branch.go1.2
```
| Add details to readme, missing an example usage. | Add details to readme, missing an example usage.
| Markdown | mit | aybabtme/fatherhood | markdown | ## Code Before:
fatherhood
==========
[](https://drone.io/github.com/aybabtme/fatherhood/latest)
Fatherhood is a JSON stream decoding library wrapping the [megajson](https://github.com/benbjohnson/megajson) scanner.
## Instruction:
Add details to readme, missing an example usage.
## Code After:
fatherhood
==========
[](https://drone.io/github.com/aybabtme/fatherhood/latest)
fatherhood is a JSON stream decoding library wrapping the scanner of
[`megajson`](https://github.com/benbjohnson/megajson).
Why use this and not megajson?
==============================
megajson uses code generation to create decoders/encoders for your types.
fatherhood doesn't.
Some combinaisons of types aren't working in megajson. They work with
fatherhood. For instance, I wrote fatherhood because megajson didn't
Why use megajson and not this?
==============================
megajson offers an encoder, fatherhood only decodes.
Aside for the code generation thing, megajson gives you drop in codecs.
Meanwhile, fatherhood's API is fugly and a pain to use.
Performance
===========
Speed is equivalent to [`megajson`](github.com/benbjohnson/megajson), since it
uses the same scanner. All kudos to [Ben Johnson](github.com/benbjohnson),
not me.
| package | ns/op | MB/s |
|:-------------:|:----------:|:-----:|
| megajson | 53'557'744 | 36.23 |
| fatherhood | 53'717'435 | 36.12 |
| encoding/json | 98'061'899 | 19.79 |
Benchmark from the following revisions:
* megajson, on `master`:
```
benbjohnson/megajson $ git rev-parse HEAD
533c329f8535e121708a0ee08ea53bda5edfbe79
```
* fatherhood, on `master`:
```
aybabtme/fatherhood $ git rev-parse HEAD
5cfd87c089e3829a28c9cfcd8993370bf787ffa1
```
* encoding/json, on `release-branch.go1.2`:
```
encoding/json $ hg summary
parent: 18712:0ddbdc3c7ce2 go1.2.1 release
go1.2.1
branch: release-branch.go1.2
```
| - fatherhood
? -
+ fatherhood
==========
[](https://drone.io/github.com/aybabtme/fatherhood/latest)
- Fatherhood is a JSON stream decoding library wrapping the [megajson](https://github.com/benbjohnson/megajson) scanner.
+ fatherhood is a JSON stream decoding library wrapping the scanner of
+ [`megajson`](https://github.com/benbjohnson/megajson).
+
+
+ Why use this and not megajson?
+ ==============================
+
+ megajson uses code generation to create decoders/encoders for your types.
+ fatherhood doesn't.
+
+ Some combinaisons of types aren't working in megajson. They work with
+ fatherhood. For instance, I wrote fatherhood because megajson didn't
+
+ Why use megajson and not this?
+ ==============================
+
+ megajson offers an encoder, fatherhood only decodes.
+
+ Aside for the code generation thing, megajson gives you drop in codecs.
+ Meanwhile, fatherhood's API is fugly and a pain to use.
+
+ Performance
+ ===========
+
+ Speed is equivalent to [`megajson`](github.com/benbjohnson/megajson), since it
+ uses the same scanner. All kudos to [Ben Johnson](github.com/benbjohnson),
+ not me.
+
+ | package | ns/op | MB/s |
+ |:-------------:|:----------:|:-----:|
+ | megajson | 53'557'744 | 36.23 |
+ | fatherhood | 53'717'435 | 36.12 |
+ | encoding/json | 98'061'899 | 19.79 |
+
+
+ Benchmark from the following revisions:
+
+ * megajson, on `master`:
+
+ ```
+ benbjohnson/megajson $ git rev-parse HEAD
+ 533c329f8535e121708a0ee08ea53bda5edfbe79
+ ```
+
+ * fatherhood, on `master`:
+
+ ```
+ aybabtme/fatherhood $ git rev-parse HEAD
+ 5cfd87c089e3829a28c9cfcd8993370bf787ffa1
+ ```
+
+ * encoding/json, on `release-branch.go1.2`:
+
+ ```
+ encoding/json $ hg summary
+ parent: 18712:0ddbdc3c7ce2 go1.2.1 release
+ go1.2.1
+ branch: release-branch.go1.2
+ ``` | 62 | 12.4 | 60 | 2 |
b33408e590dc9fa5ae47d728893a5a007406207f | setup.py | setup.py |
import sys
from setuptools import setup
if sys.argv[-1] == 'setup.py':
print('To install, run \'python setup.py install\'')
print()
sys.path.insert(0, 'potterscript')
import release
if __name__ == "__main__":
setup(
name = release.name,
version = release.__version__,
author = release.__author__,
author_email = release.__email__,
description = release.__description__,
url='https://github.com/OrkoHunter/PotterScript',
keywords='Harry Potter Programming Language Potter Script',
packages = ['potterscript'],
license = 'MIT License',
entry_points = {
'console_scripts': [
'potterscript = potterscript.pottershell:main',
]
},
install_requires = [],
test_suite = 'nose.collector',
tests_require = ['nose>=0.10.1']
)
|
import sys
from setuptools import setup
if sys.argv[-1] == 'setup.py':
print('To install, run \'python setup.py install\'')
print()
if sys.version[0] < '3':
print("Please install with Python 3. Aborting installation.")
sys.exit(0)
sys.path.insert(0, 'potterscript')
import release
if __name__ == "__main__":
setup(
name = release.name,
version = release.__version__,
author = release.__author__,
author_email = release.__email__,
description = release.__description__,
url='https://github.com/OrkoHunter/PotterScript',
keywords='Harry Potter Programming Language Potter Script',
packages = ['potterscript'],
license = 'MIT License',
entry_points = {
'console_scripts': [
'potterscript = potterscript.pottershell:main',
]
},
install_requires = [],
test_suite = 'nose.collector',
tests_require = ['nose>=0.10.1']
)
| Install only with python 3 | Install only with python 3
| Python | mit | OrkoHunter/PotterScript | python | ## Code Before:
import sys
from setuptools import setup
if sys.argv[-1] == 'setup.py':
print('To install, run \'python setup.py install\'')
print()
sys.path.insert(0, 'potterscript')
import release
if __name__ == "__main__":
setup(
name = release.name,
version = release.__version__,
author = release.__author__,
author_email = release.__email__,
description = release.__description__,
url='https://github.com/OrkoHunter/PotterScript',
keywords='Harry Potter Programming Language Potter Script',
packages = ['potterscript'],
license = 'MIT License',
entry_points = {
'console_scripts': [
'potterscript = potterscript.pottershell:main',
]
},
install_requires = [],
test_suite = 'nose.collector',
tests_require = ['nose>=0.10.1']
)
## Instruction:
Install only with python 3
## Code After:
import sys
from setuptools import setup
if sys.argv[-1] == 'setup.py':
print('To install, run \'python setup.py install\'')
print()
if sys.version[0] < '3':
print("Please install with Python 3. Aborting installation.")
sys.exit(0)
sys.path.insert(0, 'potterscript')
import release
if __name__ == "__main__":
setup(
name = release.name,
version = release.__version__,
author = release.__author__,
author_email = release.__email__,
description = release.__description__,
url='https://github.com/OrkoHunter/PotterScript',
keywords='Harry Potter Programming Language Potter Script',
packages = ['potterscript'],
license = 'MIT License',
entry_points = {
'console_scripts': [
'potterscript = potterscript.pottershell:main',
]
},
install_requires = [],
test_suite = 'nose.collector',
tests_require = ['nose>=0.10.1']
)
|
import sys
from setuptools import setup
if sys.argv[-1] == 'setup.py':
print('To install, run \'python setup.py install\'')
print()
+
+ if sys.version[0] < '3':
+ print("Please install with Python 3. Aborting installation.")
+ sys.exit(0)
sys.path.insert(0, 'potterscript')
import release
if __name__ == "__main__":
setup(
name = release.name,
version = release.__version__,
author = release.__author__,
author_email = release.__email__,
description = release.__description__,
url='https://github.com/OrkoHunter/PotterScript',
keywords='Harry Potter Programming Language Potter Script',
packages = ['potterscript'],
license = 'MIT License',
entry_points = {
'console_scripts': [
'potterscript = potterscript.pottershell:main',
]
},
install_requires = [],
test_suite = 'nose.collector',
tests_require = ['nose>=0.10.1']
) | 4 | 0.129032 | 4 | 0 |
a3bb01d93eae12d5391d0ad7b6cdb825d714a2d9 | runtime-parent/runtime-connector-parent/sqlite/src/main/java/com/speedment/runtime/connector/sqlite/internal/SqliteColumnHandler.java | runtime-parent/runtime-connector-parent/sqlite/src/main/java/com/speedment/runtime/connector/sqlite/internal/SqliteColumnHandler.java | package com.speedment.runtime.connector.sqlite.internal;
import com.speedment.runtime.config.Column;
import com.speedment.runtime.core.db.DbmsColumnHandler;
import java.util.function.Predicate;
/**
* Implementation of {@link DbmsColumnHandler} for SQLite databases.
*
* @author Emil Forslund
* @since 3.1.10
*/
public final class SqliteColumnHandler implements DbmsColumnHandler {
@Override
public Predicate<Column> excludedInInsertStatement() {
return Column::isAutoIncrement;
}
@Override
public Predicate<Column> excludedInUpdateStatement() {
return col -> false;
}
}
| package com.speedment.runtime.connector.sqlite.internal;
import com.speedment.runtime.config.Column;
import com.speedment.runtime.core.db.DbmsColumnHandler;
import java.util.function.Predicate;
/**
* Implementation of {@link DbmsColumnHandler} for SQLite databases.
*
* @author Emil Forslund
* @since 3.1.10
*/
public final class SqliteColumnHandler implements DbmsColumnHandler {
@Override
public Predicate<Column> excludedInInsertStatement() {
return col -> false;
}
@Override
public Predicate<Column> excludedInUpdateStatement() {
return col -> false;
}
}
| Remove filter that excludes auto increment columns from persists | sqlite: Remove filter that excludes auto increment columns from persists
| Java | apache-2.0 | speedment/speedment,speedment/speedment | java | ## Code Before:
package com.speedment.runtime.connector.sqlite.internal;
import com.speedment.runtime.config.Column;
import com.speedment.runtime.core.db.DbmsColumnHandler;
import java.util.function.Predicate;
/**
* Implementation of {@link DbmsColumnHandler} for SQLite databases.
*
* @author Emil Forslund
* @since 3.1.10
*/
public final class SqliteColumnHandler implements DbmsColumnHandler {
@Override
public Predicate<Column> excludedInInsertStatement() {
return Column::isAutoIncrement;
}
@Override
public Predicate<Column> excludedInUpdateStatement() {
return col -> false;
}
}
## Instruction:
sqlite: Remove filter that excludes auto increment columns from persists
## Code After:
package com.speedment.runtime.connector.sqlite.internal;
import com.speedment.runtime.config.Column;
import com.speedment.runtime.core.db.DbmsColumnHandler;
import java.util.function.Predicate;
/**
* Implementation of {@link DbmsColumnHandler} for SQLite databases.
*
* @author Emil Forslund
* @since 3.1.10
*/
public final class SqliteColumnHandler implements DbmsColumnHandler {
@Override
public Predicate<Column> excludedInInsertStatement() {
return col -> false;
}
@Override
public Predicate<Column> excludedInUpdateStatement() {
return col -> false;
}
}
| package com.speedment.runtime.connector.sqlite.internal;
import com.speedment.runtime.config.Column;
import com.speedment.runtime.core.db.DbmsColumnHandler;
import java.util.function.Predicate;
/**
* Implementation of {@link DbmsColumnHandler} for SQLite databases.
*
* @author Emil Forslund
* @since 3.1.10
*/
public final class SqliteColumnHandler implements DbmsColumnHandler {
@Override
public Predicate<Column> excludedInInsertStatement() {
- return Column::isAutoIncrement;
+ return col -> false;
}
@Override
public Predicate<Column> excludedInUpdateStatement() {
return col -> false;
}
} | 2 | 0.083333 | 1 | 1 |
4fc64532d9e8e9de073a1a812d9e565c2fad6e7c | lib/node_modules/@stdlib/math/generics/statistics/incrmin/docs/repl.txt | lib/node_modules/@stdlib/math/generics/statistics/incrmin/docs/repl.txt |
{{alias}}()
Returns an accumulator function which incrementally computes a minimum
value.
The accumulator function returns an updated minimum value if provided a
value. If not provided a value, the accumulator function returns the current
minimum value.
Input values are not type checked. If non-numeric inputs are possible, you
are advised to type check and handle accordingly before passing the value to
the accumulator function.
Returns
-------
acc: Function
Accumulator function.
Examples
--------
> var accumulator = {{alias}}();
> var minimum = accumulator()
null
> minimum = accumulator( 3.14 )
3.14
> minimum = accumulator( -5.0 )
-5.0
> minimum = accumulator( 10.1 )
-5.0
> minimum = accumulator()
-5.0
See Also
--------
|
{{alias}}()
Returns an accumulator function which incrementally computes a minimum
value.
If provided a value, the accumulator function returns an updated minimum
value. If not provided a value, the accumulator function returns the current
minimum value.
Returns
-------
acc: Function
Accumulator function.
Examples
--------
> var accumulator = {{alias}}();
> var m = accumulator()
null
> m = accumulator( 3.14 )
3.14
> m = accumulator( -5.0 )
-5.0
> m = accumulator( 10.1 )
-5.0
> m = accumulator()
-5.0
See Also
--------
| Update notes and rename variable | Update notes and rename variable
| Text | apache-2.0 | stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib | text | ## Code Before:
{{alias}}()
Returns an accumulator function which incrementally computes a minimum
value.
The accumulator function returns an updated minimum value if provided a
value. If not provided a value, the accumulator function returns the current
minimum value.
Input values are not type checked. If non-numeric inputs are possible, you
are advised to type check and handle accordingly before passing the value to
the accumulator function.
Returns
-------
acc: Function
Accumulator function.
Examples
--------
> var accumulator = {{alias}}();
> var minimum = accumulator()
null
> minimum = accumulator( 3.14 )
3.14
> minimum = accumulator( -5.0 )
-5.0
> minimum = accumulator( 10.1 )
-5.0
> minimum = accumulator()
-5.0
See Also
--------
## Instruction:
Update notes and rename variable
## Code After:
{{alias}}()
Returns an accumulator function which incrementally computes a minimum
value.
If provided a value, the accumulator function returns an updated minimum
value. If not provided a value, the accumulator function returns the current
minimum value.
Returns
-------
acc: Function
Accumulator function.
Examples
--------
> var accumulator = {{alias}}();
> var m = accumulator()
null
> m = accumulator( 3.14 )
3.14
> m = accumulator( -5.0 )
-5.0
> m = accumulator( 10.1 )
-5.0
> m = accumulator()
-5.0
See Also
--------
|
{{alias}}()
Returns an accumulator function which incrementally computes a minimum
value.
- The accumulator function returns an updated minimum value if provided a
+ If provided a value, the accumulator function returns an updated minimum
value. If not provided a value, the accumulator function returns the current
minimum value.
-
- Input values are not type checked. If non-numeric inputs are possible, you
- are advised to type check and handle accordingly before passing the value to
- the accumulator function.
Returns
-------
acc: Function
Accumulator function.
Examples
--------
> var accumulator = {{alias}}();
- > var minimum = accumulator()
? ------
+ > var m = accumulator()
null
- > minimum = accumulator( 3.14 )
? ------
+ > m = accumulator( 3.14 )
3.14
- > minimum = accumulator( -5.0 )
? ------
+ > m = accumulator( -5.0 )
-5.0
- > minimum = accumulator( 10.1 )
? ------
+ > m = accumulator( 10.1 )
-5.0
- > minimum = accumulator()
? ------
+ > m = accumulator()
-5.0
See Also
--------
| 16 | 0.457143 | 6 | 10 |
2b46844cb1eb11776ab2217fbf4a6aec1f0fe307 | README.md | README.md | Written in [Go](https://golang.org/), hosted on [Google App Engine](https://cloud.google.com/appengine/).
## Features
- Requires Google authentication to create pastes (to deter spammers/ abuse)
- Automatic language detection/ syntax highlighting via highlight.js
- Solarized color theme
| Written in [Go](https://golang.org/), hosted on [Google App Engine](https://cloud.google.com/appengine/).
## Features
- Requires Google authentication to create pastes (to deter spammers/ abuse)
- Automatic language detection/ syntax highlighting via highlight.js
- Solarized color theme
## Development
Local Development:
```
dev_appserver.py app.yaml
```
Deploy:
```
gcloud --project dsouza-paste app deploy
```
Update Indexes:
```
# Create new indexes
gcloud --project dsouza-paste datastore create-indexes index.yaml
# Delete old/ unused indexes
gcloud --project dsouza-paste datastore cleanup-indexes index.yaml
```
| Add useful development commands to readme | Add useful development commands to readme
| Markdown | apache-2.0 | jasonrdsouza/paste,jasonrdsouza/paste,jasonrdsouza/paste | markdown | ## Code Before:
Written in [Go](https://golang.org/), hosted on [Google App Engine](https://cloud.google.com/appengine/).
## Features
- Requires Google authentication to create pastes (to deter spammers/ abuse)
- Automatic language detection/ syntax highlighting via highlight.js
- Solarized color theme
## Instruction:
Add useful development commands to readme
## Code After:
Written in [Go](https://golang.org/), hosted on [Google App Engine](https://cloud.google.com/appengine/).
## Features
- Requires Google authentication to create pastes (to deter spammers/ abuse)
- Automatic language detection/ syntax highlighting via highlight.js
- Solarized color theme
## Development
Local Development:
```
dev_appserver.py app.yaml
```
Deploy:
```
gcloud --project dsouza-paste app deploy
```
Update Indexes:
```
# Create new indexes
gcloud --project dsouza-paste datastore create-indexes index.yaml
# Delete old/ unused indexes
gcloud --project dsouza-paste datastore cleanup-indexes index.yaml
```
| Written in [Go](https://golang.org/), hosted on [Google App Engine](https://cloud.google.com/appengine/).
## Features
- Requires Google authentication to create pastes (to deter spammers/ abuse)
- Automatic language detection/ syntax highlighting via highlight.js
- Solarized color theme
+ ## Development
+ Local Development:
+ ```
+ dev_appserver.py app.yaml
+ ```
+
+ Deploy:
+ ```
+ gcloud --project dsouza-paste app deploy
+ ```
+
+ Update Indexes:
+ ```
+ # Create new indexes
+ gcloud --project dsouza-paste datastore create-indexes index.yaml
+
+ # Delete old/ unused indexes
+ gcloud --project dsouza-paste datastore cleanup-indexes index.yaml
+ ```
+ | 20 | 2.857143 | 20 | 0 |
4b8850a8861e5ddf6a66fc2639c669cdb68c5281 | ipa-fun-install-rpms.sh | ipa-fun-install-rpms.sh | set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $DIR/config.sh
# Set DIST_DIR if given via command line
if [[ ! $1 == "" ]]
then
if [[ ! -d $WORKING_DIR/$1 ]]
then
echo "$WORKING_DIR/$1 does not exist"
exit 1
fi
DIST_DIR=$WORKING_DIR/$1/dist
fi
pushd $DIST_DIR
sudo yum localinstall freeipa-* -y
popd
|
if [[ `rpm -qa | grep freeipa` != '' ]]
then
sudo ipa-server-install --uninstall -U
sudo pkidestroy -s CA -i pki-tomcat
sudo rm -rf /var/log/pki/pki-tomcat
sudo rm -rf /etc/sysconfig/pki-tomcat
sudo rm -rf /etc/sysconfig/pki/tomcat/pki-tomcat
sudo rm -rf /var/lib/pki/pki-tomcat
sudo rm -rf /etc/pki/pki-tomcat
sudo yum remove freeipa-* -y
fi
# If any command here fails, exit the script
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $DIR/config.sh
# Set DIST_DIR if given via command line
if [[ ! $1 == "" ]]
then
if [[ ! -d $WORKING_DIR/$1 ]]
then
echo "$WORKING_DIR/$1 does not exist"
exit 1
fi
DIST_DIR=$WORKING_DIR/$1/dist
fi
pushd $DIST_DIR
sudo yum localinstall freeipa-* -y
popd
| Remove previous packages and server instance | Remove previous packages and server instance
| Shell | mit | pspacek/labtool,tomaskrizek/labtool,pvoborni/labtool,pvoborni/labtool,pspacek/labtool,tomaskrizek/labtool | shell | ## Code Before:
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $DIR/config.sh
# Set DIST_DIR if given via command line
if [[ ! $1 == "" ]]
then
if [[ ! -d $WORKING_DIR/$1 ]]
then
echo "$WORKING_DIR/$1 does not exist"
exit 1
fi
DIST_DIR=$WORKING_DIR/$1/dist
fi
pushd $DIST_DIR
sudo yum localinstall freeipa-* -y
popd
## Instruction:
Remove previous packages and server instance
## Code After:
if [[ `rpm -qa | grep freeipa` != '' ]]
then
sudo ipa-server-install --uninstall -U
sudo pkidestroy -s CA -i pki-tomcat
sudo rm -rf /var/log/pki/pki-tomcat
sudo rm -rf /etc/sysconfig/pki-tomcat
sudo rm -rf /etc/sysconfig/pki/tomcat/pki-tomcat
sudo rm -rf /var/lib/pki/pki-tomcat
sudo rm -rf /etc/pki/pki-tomcat
sudo yum remove freeipa-* -y
fi
# If any command here fails, exit the script
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $DIR/config.sh
# Set DIST_DIR if given via command line
if [[ ! $1 == "" ]]
then
if [[ ! -d $WORKING_DIR/$1 ]]
then
echo "$WORKING_DIR/$1 does not exist"
exit 1
fi
DIST_DIR=$WORKING_DIR/$1/dist
fi
pushd $DIST_DIR
sudo yum localinstall freeipa-* -y
popd
| +
+ if [[ `rpm -qa | grep freeipa` != '' ]]
+ then
+ sudo ipa-server-install --uninstall -U
+ sudo pkidestroy -s CA -i pki-tomcat
+ sudo rm -rf /var/log/pki/pki-tomcat
+ sudo rm -rf /etc/sysconfig/pki-tomcat
+ sudo rm -rf /etc/sysconfig/pki/tomcat/pki-tomcat
+ sudo rm -rf /var/lib/pki/pki-tomcat
+ sudo rm -rf /etc/pki/pki-tomcat
+ sudo yum remove freeipa-* -y
+ fi
+
+ # If any command here fails, exit the script
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $DIR/config.sh
# Set DIST_DIR if given via command line
if [[ ! $1 == "" ]]
then
if [[ ! -d $WORKING_DIR/$1 ]]
then
echo "$WORKING_DIR/$1 does not exist"
exit 1
fi
DIST_DIR=$WORKING_DIR/$1/dist
fi
pushd $DIST_DIR
sudo yum localinstall freeipa-* -y
popd
| 14 | 0.608696 | 14 | 0 |
afb400e16c1335531f259218a8b9937de48644e9 | polyaxon/checks/streams.py | polyaxon/checks/streams.py | from checks.base import Check
from checks.results import Result
from libs.api import get_settings_ws_api_url
from libs.http import safe_request
class StreamsCheck(Check):
@classmethod
def run(cls):
response = safe_request(get_settings_ws_api_url(), 'GET')
status_code = response.status_code
if status_code == 200:
result = Result()
else:
result = Result(message='Service is not healthy, response {}'.format(status_code),
severity=Result.ERROR)
return {'STREAMS': result}
| from checks.base import Check
from checks.results import Result
from libs.api import get_settings_ws_api_url
from libs.http import safe_request
class StreamsCheck(Check):
@classmethod
def run(cls):
response = safe_request('{}/_health'.format(get_settings_ws_api_url()), 'GET')
status_code = response.status_code
if status_code == 200:
result = Result()
else:
result = Result(message='Service is not healthy, response {}'.format(status_code),
severity=Result.ERROR)
return {'STREAMS': result}
| Update stream health health api url | Update stream health health api url
| Python | apache-2.0 | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | python | ## Code Before:
from checks.base import Check
from checks.results import Result
from libs.api import get_settings_ws_api_url
from libs.http import safe_request
class StreamsCheck(Check):
@classmethod
def run(cls):
response = safe_request(get_settings_ws_api_url(), 'GET')
status_code = response.status_code
if status_code == 200:
result = Result()
else:
result = Result(message='Service is not healthy, response {}'.format(status_code),
severity=Result.ERROR)
return {'STREAMS': result}
## Instruction:
Update stream health health api url
## Code After:
from checks.base import Check
from checks.results import Result
from libs.api import get_settings_ws_api_url
from libs.http import safe_request
class StreamsCheck(Check):
@classmethod
def run(cls):
response = safe_request('{}/_health'.format(get_settings_ws_api_url()), 'GET')
status_code = response.status_code
if status_code == 200:
result = Result()
else:
result = Result(message='Service is not healthy, response {}'.format(status_code),
severity=Result.ERROR)
return {'STREAMS': result}
| from checks.base import Check
from checks.results import Result
from libs.api import get_settings_ws_api_url
from libs.http import safe_request
class StreamsCheck(Check):
@classmethod
def run(cls):
- response = safe_request(get_settings_ws_api_url(), 'GET')
+ response = safe_request('{}/_health'.format(get_settings_ws_api_url()), 'GET')
? ++++++++++++++++++++ +
status_code = response.status_code
if status_code == 200:
result = Result()
else:
result = Result(message='Service is not healthy, response {}'.format(status_code),
severity=Result.ERROR)
return {'STREAMS': result} | 2 | 0.105263 | 1 | 1 |
cf752f01ef49fe6f26789ad3220863f1bd37a44f | raven/src/main/java/net/kencochrane/raven/marshaller/json/MessageInterfaceBinding.java | raven/src/main/java/net/kencochrane/raven/marshaller/json/MessageInterfaceBinding.java | package net.kencochrane.raven.marshaller.json;
import com.fasterxml.jackson.core.JsonGenerator;
import net.kencochrane.raven.event.interfaces.MessageInterface;
import java.io.IOException;
public class MessageInterfaceBinding implements InterfaceBinding<MessageInterface> {
private static final String MESSAGE_PARAMETER = "message";
private static final String PARAMS_PARAMETER = "params";
@Override
public void writeInterface(JsonGenerator generator, MessageInterface messageInterface) throws IOException {
generator.writeStartObject();
generator.writeStringField(MESSAGE_PARAMETER, messageInterface.getMessage());
generator.writeArrayFieldStart(PARAMS_PARAMETER);
for (String parameter : messageInterface.getParams()) {
generator.writeString(parameter);
}
generator.writeEndArray();
generator.writeEndObject();
}
}
| package net.kencochrane.raven.marshaller.json;
import com.fasterxml.jackson.core.JsonGenerator;
import net.kencochrane.raven.event.interfaces.MessageInterface;
import java.io.IOException;
public class MessageInterfaceBinding implements InterfaceBinding<MessageInterface> {
/**
* Maximum length for a message.
*/
public static final int MAX_MESSAGE_LENGTH = 1000;
private static final String MESSAGE_PARAMETER = "message";
private static final String PARAMS_PARAMETER = "params";
/**
* Formats a message, ensuring that the maximum length {@link #MAX_MESSAGE_LENGTH} isn't reached.
*
* @param message message to format.
* @return formatted message (shortened if necessary).
*/
private String formatMessage(String message) {
if (message == null)
return null;
else if (message.length() > MAX_MESSAGE_LENGTH)
return message.substring(0, MAX_MESSAGE_LENGTH);
else return message;
}
@Override
public void writeInterface(JsonGenerator generator, MessageInterface messageInterface) throws IOException {
generator.writeStartObject();
generator.writeStringField(MESSAGE_PARAMETER, formatMessage(messageInterface.getMessage()));
generator.writeArrayFieldStart(PARAMS_PARAMETER);
for (String parameter : messageInterface.getParams()) {
generator.writeString(parameter);
}
generator.writeEndArray();
generator.writeEndObject();
}
}
| Set a maximum size for the Message interface | Set a maximum size for the Message interface
| Java | bsd-3-clause | littleyang/raven-java,reki2000/raven-java6,buckett/raven-java,galmeida/raven-java,galmeida/raven-java,littleyang/raven-java,buckett/raven-java,reki2000/raven-java6 | java | ## Code Before:
package net.kencochrane.raven.marshaller.json;
import com.fasterxml.jackson.core.JsonGenerator;
import net.kencochrane.raven.event.interfaces.MessageInterface;
import java.io.IOException;
public class MessageInterfaceBinding implements InterfaceBinding<MessageInterface> {
private static final String MESSAGE_PARAMETER = "message";
private static final String PARAMS_PARAMETER = "params";
@Override
public void writeInterface(JsonGenerator generator, MessageInterface messageInterface) throws IOException {
generator.writeStartObject();
generator.writeStringField(MESSAGE_PARAMETER, messageInterface.getMessage());
generator.writeArrayFieldStart(PARAMS_PARAMETER);
for (String parameter : messageInterface.getParams()) {
generator.writeString(parameter);
}
generator.writeEndArray();
generator.writeEndObject();
}
}
## Instruction:
Set a maximum size for the Message interface
## Code After:
package net.kencochrane.raven.marshaller.json;
import com.fasterxml.jackson.core.JsonGenerator;
import net.kencochrane.raven.event.interfaces.MessageInterface;
import java.io.IOException;
public class MessageInterfaceBinding implements InterfaceBinding<MessageInterface> {
/**
* Maximum length for a message.
*/
public static final int MAX_MESSAGE_LENGTH = 1000;
private static final String MESSAGE_PARAMETER = "message";
private static final String PARAMS_PARAMETER = "params";
/**
* Formats a message, ensuring that the maximum length {@link #MAX_MESSAGE_LENGTH} isn't reached.
*
* @param message message to format.
* @return formatted message (shortened if necessary).
*/
private String formatMessage(String message) {
if (message == null)
return null;
else if (message.length() > MAX_MESSAGE_LENGTH)
return message.substring(0, MAX_MESSAGE_LENGTH);
else return message;
}
@Override
public void writeInterface(JsonGenerator generator, MessageInterface messageInterface) throws IOException {
generator.writeStartObject();
generator.writeStringField(MESSAGE_PARAMETER, formatMessage(messageInterface.getMessage()));
generator.writeArrayFieldStart(PARAMS_PARAMETER);
for (String parameter : messageInterface.getParams()) {
generator.writeString(parameter);
}
generator.writeEndArray();
generator.writeEndObject();
}
}
| package net.kencochrane.raven.marshaller.json;
import com.fasterxml.jackson.core.JsonGenerator;
import net.kencochrane.raven.event.interfaces.MessageInterface;
import java.io.IOException;
public class MessageInterfaceBinding implements InterfaceBinding<MessageInterface> {
+ /**
+ * Maximum length for a message.
+ */
+ public static final int MAX_MESSAGE_LENGTH = 1000;
private static final String MESSAGE_PARAMETER = "message";
private static final String PARAMS_PARAMETER = "params";
+
+ /**
+ * Formats a message, ensuring that the maximum length {@link #MAX_MESSAGE_LENGTH} isn't reached.
+ *
+ * @param message message to format.
+ * @return formatted message (shortened if necessary).
+ */
+ private String formatMessage(String message) {
+ if (message == null)
+ return null;
+ else if (message.length() > MAX_MESSAGE_LENGTH)
+ return message.substring(0, MAX_MESSAGE_LENGTH);
+ else return message;
+ }
@Override
public void writeInterface(JsonGenerator generator, MessageInterface messageInterface) throws IOException {
generator.writeStartObject();
- generator.writeStringField(MESSAGE_PARAMETER, messageInterface.getMessage());
+ generator.writeStringField(MESSAGE_PARAMETER, formatMessage(messageInterface.getMessage()));
? ++++++++++++++ +
generator.writeArrayFieldStart(PARAMS_PARAMETER);
for (String parameter : messageInterface.getParams()) {
generator.writeString(parameter);
}
generator.writeEndArray();
generator.writeEndObject();
}
} | 20 | 0.869565 | 19 | 1 |
2814f5b2bbd2c53c165f13009eb85cb2c5030b57 | chicago/search_indexes.py | chicago/search_indexes.py | from datetime import datetime
from councilmatic_core.haystack_indexes import BillIndex
from django.conf import settings
from haystack import indexes
import pytz
from chicago.models import ChicagoBill
app_timezone = pytz.timezone(settings.TIME_ZONE)
class ChicagoBillIndex(BillIndex, indexes.Indexable):
topics = indexes.MultiValueField(faceted=True)
def get_model(self):
return ChicagoBill
def prepare(self, obj):
data = super(ChicagoBillIndex, self).prepare(obj)
boost = 0
if obj.last_action_date:
now = app_timezone.localize(datetime.now())
# obj.last_action_date can be in the future
weeks_passed = (now - obj.last_action_date).days / 7 + 1
boost = 1 + 1.0 / max(weeks_passed, 1)
data['boost'] = boost
return data
def prepare_topics(self, obj):
return obj.topics
def prepare_last_action_date(self, obj):
if not obj.last_action_date:
action_dates = [a.date for a in obj.actions.all()]
if action_dates:
last_action_date = max(action_dates)
return datetime.strptime(last_action_date, '%Y-%m-%d').date()
return obj.last_action_date.date()
| from datetime import datetime
from councilmatic_core.haystack_indexes import BillIndex
from django.conf import settings
from haystack import indexes
import pytz
from chicago.models import ChicagoBill
app_timezone = pytz.timezone(settings.TIME_ZONE)
class ChicagoBillIndex(BillIndex, indexes.Indexable):
topics = indexes.MultiValueField(faceted=True)
def get_model(self):
return ChicagoBill
def prepare(self, obj):
data = super(ChicagoBillIndex, self).prepare(obj)
boost = 0
if data['last_action_date']:
today = app_timezone.localize(datetime.now()).date()
# data['last_action_date'] can be in the future
weeks_passed = (today - data['last_action_date']).days / 7 + 1
boost = 1 + 1.0 / max(weeks_passed, 1)
data['boost'] = boost
return data
def prepare_topics(self, obj):
return obj.topics
def prepare_last_action_date(self, obj):
if not obj.last_action_date:
action_dates = [a.date for a in obj.actions.all()]
if action_dates:
last_action_date = max(action_dates)
return datetime.strptime(last_action_date, '%Y-%m-%d').date()
return obj.last_action_date.date()
| Use prepared data, rather than the object last action date, to determine boost | Use prepared data, rather than the object last action date, to determine boost
| Python | mit | datamade/chi-councilmatic,datamade/chi-councilmatic,datamade/chi-councilmatic,datamade/chi-councilmatic,datamade/chi-councilmatic | python | ## Code Before:
from datetime import datetime
from councilmatic_core.haystack_indexes import BillIndex
from django.conf import settings
from haystack import indexes
import pytz
from chicago.models import ChicagoBill
app_timezone = pytz.timezone(settings.TIME_ZONE)
class ChicagoBillIndex(BillIndex, indexes.Indexable):
topics = indexes.MultiValueField(faceted=True)
def get_model(self):
return ChicagoBill
def prepare(self, obj):
data = super(ChicagoBillIndex, self).prepare(obj)
boost = 0
if obj.last_action_date:
now = app_timezone.localize(datetime.now())
# obj.last_action_date can be in the future
weeks_passed = (now - obj.last_action_date).days / 7 + 1
boost = 1 + 1.0 / max(weeks_passed, 1)
data['boost'] = boost
return data
def prepare_topics(self, obj):
return obj.topics
def prepare_last_action_date(self, obj):
if not obj.last_action_date:
action_dates = [a.date for a in obj.actions.all()]
if action_dates:
last_action_date = max(action_dates)
return datetime.strptime(last_action_date, '%Y-%m-%d').date()
return obj.last_action_date.date()
## Instruction:
Use prepared data, rather than the object last action date, to determine boost
## Code After:
from datetime import datetime
from councilmatic_core.haystack_indexes import BillIndex
from django.conf import settings
from haystack import indexes
import pytz
from chicago.models import ChicagoBill
app_timezone = pytz.timezone(settings.TIME_ZONE)
class ChicagoBillIndex(BillIndex, indexes.Indexable):
topics = indexes.MultiValueField(faceted=True)
def get_model(self):
return ChicagoBill
def prepare(self, obj):
data = super(ChicagoBillIndex, self).prepare(obj)
boost = 0
if data['last_action_date']:
today = app_timezone.localize(datetime.now()).date()
# data['last_action_date'] can be in the future
weeks_passed = (today - data['last_action_date']).days / 7 + 1
boost = 1 + 1.0 / max(weeks_passed, 1)
data['boost'] = boost
return data
def prepare_topics(self, obj):
return obj.topics
def prepare_last_action_date(self, obj):
if not obj.last_action_date:
action_dates = [a.date for a in obj.actions.all()]
if action_dates:
last_action_date = max(action_dates)
return datetime.strptime(last_action_date, '%Y-%m-%d').date()
return obj.last_action_date.date()
| from datetime import datetime
from councilmatic_core.haystack_indexes import BillIndex
from django.conf import settings
from haystack import indexes
import pytz
from chicago.models import ChicagoBill
app_timezone = pytz.timezone(settings.TIME_ZONE)
class ChicagoBillIndex(BillIndex, indexes.Indexable):
topics = indexes.MultiValueField(faceted=True)
def get_model(self):
return ChicagoBill
def prepare(self, obj):
data = super(ChicagoBillIndex, self).prepare(obj)
boost = 0
- if obj.last_action_date:
- now = app_timezone.localize(datetime.now())
+ if data['last_action_date']:
+ today = app_timezone.localize(datetime.now()).date()
+
- # obj.last_action_date can be in the future
? ^^^^
+ # data['last_action_date'] can be in the future
? ^^^^^^ ++
- weeks_passed = (now - obj.last_action_date).days / 7 + 1
? ^ ^ ^^^^
+ weeks_passed = (today - data['last_action_date']).days / 7 + 1
? ^ ^^^ ^^^^^^ ++
+
boost = 1 + 1.0 / max(weeks_passed, 1)
data['boost'] = boost
return data
def prepare_topics(self, obj):
return obj.topics
def prepare_last_action_date(self, obj):
if not obj.last_action_date:
action_dates = [a.date for a in obj.actions.all()]
if action_dates:
last_action_date = max(action_dates)
return datetime.strptime(last_action_date, '%Y-%m-%d').date()
return obj.last_action_date.date() | 10 | 0.212766 | 6 | 4 |
caa73e916bdce15f0928fdff3061199f3c799dcc | git/aliases.zsh | git/aliases.zsh | alias git='hub'
alias gitcheck="find . -maxdepth 1 -type d -exec sh -c 'echo {}; cd {} && git wtf; echo' \;"
alias gitpurgelocal="git checkout master && git branch --merged | grep -v master | xargs git branch -d"
alias gitpurgeremote="git checkout master && git remote prune origin && git branch -r --merged | grep -v master | sed -e 's/origin\\//:/' | xargs git push origin"
| alias gitcheck="find . -maxdepth 1 -type d -exec sh -c 'echo {}; cd {} && git wtf; echo' \;"
alias gitpurgelocal="git checkout master && git branch --merged | grep -v master | xargs git branch -d"
alias gitpurgeremote="git checkout master && git remote prune origin && git branch -r --merged | grep -v master | sed -e 's/origin\\//:/' | xargs git push origin"
| Stop using the hub wrapper for git | Stop using the hub wrapper for git
I rarely use any of the features.
| Shell | mit | peplin/dotfiles,peplin/dotfiles,peplin/dotfiles,peplin/dotfiles | shell | ## Code Before:
alias git='hub'
alias gitcheck="find . -maxdepth 1 -type d -exec sh -c 'echo {}; cd {} && git wtf; echo' \;"
alias gitpurgelocal="git checkout master && git branch --merged | grep -v master | xargs git branch -d"
alias gitpurgeremote="git checkout master && git remote prune origin && git branch -r --merged | grep -v master | sed -e 's/origin\\//:/' | xargs git push origin"
## Instruction:
Stop using the hub wrapper for git
I rarely use any of the features.
## Code After:
alias gitcheck="find . -maxdepth 1 -type d -exec sh -c 'echo {}; cd {} && git wtf; echo' \;"
alias gitpurgelocal="git checkout master && git branch --merged | grep -v master | xargs git branch -d"
alias gitpurgeremote="git checkout master && git remote prune origin && git branch -r --merged | grep -v master | sed -e 's/origin\\//:/' | xargs git push origin"
| - alias git='hub'
alias gitcheck="find . -maxdepth 1 -type d -exec sh -c 'echo {}; cd {} && git wtf; echo' \;"
alias gitpurgelocal="git checkout master && git branch --merged | grep -v master | xargs git branch -d"
alias gitpurgeremote="git checkout master && git remote prune origin && git branch -r --merged | grep -v master | sed -e 's/origin\\//:/' | xargs git push origin" | 1 | 0.25 | 0 | 1 |
9b2bf34e049c870cab44ae8872b0f0f915c12c7b | pkgs/development/python-modules/execnet/default.nix | pkgs/development/python-modules/execnet/default.nix | { stdenv
, buildPythonPackage
, fetchPypi
, pytest_3
, setuptools_scm
, apipkg
}:
buildPythonPackage rec {
pname = "execnet";
version = "1.5.0";
src = fetchPypi {
inherit pname version;
sha256 = "a7a84d5fa07a089186a329528f127c9d73b9de57f1a1131b82bb5320ee651f6a";
};
checkInputs = [ pytest_3 ];
nativeBuildInputs = [ setuptools_scm ];
propagatedBuildInputs = [ apipkg ];
# remove vbox tests
postPatch = ''
rm -v testing/test_termination.py
rm -v testing/test_channel.py
rm -v testing/test_xspec.py
rm -v testing/test_gateway.py
'';
checkPhase = ''
py.test testing
'';
# not yet compatible with pytest 4
doCheck = false;
__darwinAllowLocalNetworking = true;
meta = with stdenv.lib; {
description = "Rapid multi-Python deployment";
license = licenses.gpl2;
homepage = "http://codespeak.net/execnet";
maintainers = with maintainers; [ nand0p ];
};
}
| { stdenv
, lib
, buildPythonPackage
, isPyPy
, fetchPypi
, pytest_3
, setuptools_scm
, apipkg
}:
buildPythonPackage rec {
pname = "execnet";
version = "1.5.0";
src = fetchPypi {
inherit pname version;
sha256 = "a7a84d5fa07a089186a329528f127c9d73b9de57f1a1131b82bb5320ee651f6a";
};
checkInputs = [ pytest_3 ];
nativeBuildInputs = [ setuptools_scm ];
propagatedBuildInputs = [ apipkg ];
# remove vbox tests
postPatch = ''
rm -v testing/test_termination.py
rm -v testing/test_channel.py
rm -v testing/test_xspec.py
rm -v testing/test_gateway.py
${lib.optionalString isPyPy "rm -v testing/test_multi.py"}
'';
checkPhase = ''
py.test testing
'';
# not yet compatible with pytest 4
doCheck = false;
__darwinAllowLocalNetworking = true;
meta = with stdenv.lib; {
description = "Rapid multi-Python deployment";
license = licenses.gpl2;
homepage = "http://codespeak.net/execnet";
maintainers = with maintainers; [ nand0p ];
};
}
| Remove flaky test on PyPy. | pythonPackages.execnet: Remove flaky test on PyPy.
| Nix | mit | NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs | nix | ## Code Before:
{ stdenv
, buildPythonPackage
, fetchPypi
, pytest_3
, setuptools_scm
, apipkg
}:
buildPythonPackage rec {
pname = "execnet";
version = "1.5.0";
src = fetchPypi {
inherit pname version;
sha256 = "a7a84d5fa07a089186a329528f127c9d73b9de57f1a1131b82bb5320ee651f6a";
};
checkInputs = [ pytest_3 ];
nativeBuildInputs = [ setuptools_scm ];
propagatedBuildInputs = [ apipkg ];
# remove vbox tests
postPatch = ''
rm -v testing/test_termination.py
rm -v testing/test_channel.py
rm -v testing/test_xspec.py
rm -v testing/test_gateway.py
'';
checkPhase = ''
py.test testing
'';
# not yet compatible with pytest 4
doCheck = false;
__darwinAllowLocalNetworking = true;
meta = with stdenv.lib; {
description = "Rapid multi-Python deployment";
license = licenses.gpl2;
homepage = "http://codespeak.net/execnet";
maintainers = with maintainers; [ nand0p ];
};
}
## Instruction:
pythonPackages.execnet: Remove flaky test on PyPy.
## Code After:
{ stdenv
, lib
, buildPythonPackage
, isPyPy
, fetchPypi
, pytest_3
, setuptools_scm
, apipkg
}:
buildPythonPackage rec {
pname = "execnet";
version = "1.5.0";
src = fetchPypi {
inherit pname version;
sha256 = "a7a84d5fa07a089186a329528f127c9d73b9de57f1a1131b82bb5320ee651f6a";
};
checkInputs = [ pytest_3 ];
nativeBuildInputs = [ setuptools_scm ];
propagatedBuildInputs = [ apipkg ];
# remove vbox tests
postPatch = ''
rm -v testing/test_termination.py
rm -v testing/test_channel.py
rm -v testing/test_xspec.py
rm -v testing/test_gateway.py
${lib.optionalString isPyPy "rm -v testing/test_multi.py"}
'';
checkPhase = ''
py.test testing
'';
# not yet compatible with pytest 4
doCheck = false;
__darwinAllowLocalNetworking = true;
meta = with stdenv.lib; {
description = "Rapid multi-Python deployment";
license = licenses.gpl2;
homepage = "http://codespeak.net/execnet";
maintainers = with maintainers; [ nand0p ];
};
}
| { stdenv
+ , lib
, buildPythonPackage
+ , isPyPy
, fetchPypi
, pytest_3
, setuptools_scm
, apipkg
}:
buildPythonPackage rec {
pname = "execnet";
version = "1.5.0";
src = fetchPypi {
inherit pname version;
sha256 = "a7a84d5fa07a089186a329528f127c9d73b9de57f1a1131b82bb5320ee651f6a";
};
- checkInputs = [ pytest_3 ];
? -
+ checkInputs = [ pytest_3 ];
nativeBuildInputs = [ setuptools_scm ];
propagatedBuildInputs = [ apipkg ];
# remove vbox tests
postPatch = ''
rm -v testing/test_termination.py
rm -v testing/test_channel.py
rm -v testing/test_xspec.py
rm -v testing/test_gateway.py
+ ${lib.optionalString isPyPy "rm -v testing/test_multi.py"}
'';
checkPhase = ''
py.test testing
'';
# not yet compatible with pytest 4
doCheck = false;
__darwinAllowLocalNetworking = true;
meta = with stdenv.lib; {
description = "Rapid multi-Python deployment";
license = licenses.gpl2;
homepage = "http://codespeak.net/execnet";
maintainers = with maintainers; [ nand0p ];
};
} | 5 | 0.108696 | 4 | 1 |
d1096de55c0a7e56ad392acb458da9783f1671e4 | lib/gds_api/base.rb | lib/gds_api/base.rb | require_relative 'json_utils'
class GdsApi::Base
include GdsApi::JsonUtils
def initialize(environment)
adapter_name = self.class.to_s.split("::").last.downcase
self.endpoint = "http://#{adapter_name}.#{environment}.alphagov.co.uk"
end
def url_for_slug(slug,options={})
base = "#{base_url}/#{slug}.json"
params = options.map { |k,v| "#{k}=#{v}" }
base = base + "?#{params.join("&")}" unless options.empty?
base
end
private
attr_accessor :endpoint
end | require_relative 'json_utils'
class GdsApi::Base
include GdsApi::JsonUtils
def initialize(environment, endpoint_url = nil)
adapter_name = self.class.to_s.split("::").last.downcase
if endpoint_url
self.endpoint = endpoint_url
elsif environment == 'development'
self.endpoint = "http://#{adapter_name}.dev.gov.uk"
else
self.endpoint = "http://#{adapter_name}.#{environment}.alphagov.co.uk"
end
end
def url_for_slug(slug,options={})
base = "#{base_url}/#{slug}.json"
params = options.map { |k,v| "#{k}=#{v}" }
base = base + "?#{params.join("&")}" unless options.empty?
base
end
private
attr_accessor :endpoint
end | Allow a specific endpoint URL to be passed in | Allow a specific endpoint URL to be passed in
| Ruby | mit | theodi/gds-api-adapters,bitzesty/gds-api-adapters,theodi/gds-api-adapters,bitzesty/gds-api-adapters,alphagov/gds-api-adapters | ruby | ## Code Before:
require_relative 'json_utils'
class GdsApi::Base
include GdsApi::JsonUtils
def initialize(environment)
adapter_name = self.class.to_s.split("::").last.downcase
self.endpoint = "http://#{adapter_name}.#{environment}.alphagov.co.uk"
end
def url_for_slug(slug,options={})
base = "#{base_url}/#{slug}.json"
params = options.map { |k,v| "#{k}=#{v}" }
base = base + "?#{params.join("&")}" unless options.empty?
base
end
private
attr_accessor :endpoint
end
## Instruction:
Allow a specific endpoint URL to be passed in
## Code After:
require_relative 'json_utils'
class GdsApi::Base
include GdsApi::JsonUtils
def initialize(environment, endpoint_url = nil)
adapter_name = self.class.to_s.split("::").last.downcase
if endpoint_url
self.endpoint = endpoint_url
elsif environment == 'development'
self.endpoint = "http://#{adapter_name}.dev.gov.uk"
else
self.endpoint = "http://#{adapter_name}.#{environment}.alphagov.co.uk"
end
end
def url_for_slug(slug,options={})
base = "#{base_url}/#{slug}.json"
params = options.map { |k,v| "#{k}=#{v}" }
base = base + "?#{params.join("&")}" unless options.empty?
base
end
private
attr_accessor :endpoint
end | require_relative 'json_utils'
class GdsApi::Base
include GdsApi::JsonUtils
- def initialize(environment)
+ def initialize(environment, endpoint_url = nil)
adapter_name = self.class.to_s.split("::").last.downcase
+
+ if endpoint_url
+ self.endpoint = endpoint_url
+ elsif environment == 'development'
+ self.endpoint = "http://#{adapter_name}.dev.gov.uk"
+ else
- self.endpoint = "http://#{adapter_name}.#{environment}.alphagov.co.uk"
+ self.endpoint = "http://#{adapter_name}.#{environment}.alphagov.co.uk"
? ++
+ end
end
def url_for_slug(slug,options={})
base = "#{base_url}/#{slug}.json"
params = options.map { |k,v| "#{k}=#{v}" }
base = base + "?#{params.join("&")}" unless options.empty?
base
end
private
attr_accessor :endpoint
end | 11 | 0.55 | 9 | 2 |
33b2bd1489ac69f34627320aff0010995a0fe563 | public/index.html | public/index.html | <!DOCTYPE html>
<html>
<head>
<title>BlockLauncher Skin Upload</title>
<style>
body {
font-family: Arial, sans-serif;
}
</style>
</head>
<body>
<h1>BlockLauncher Skin Upload</h1>
<p>You need an account from any of these servers in order to upload a skin.
This is to prevent other people from uploading a skin in your name.</p>
<table>
<tr>
<td>Lifeboat:</td>
<td><a href="lbsg.html">Login</a></td>
<td><a href="https://play.google.com/store/apps/details?id=com.lifeboat">Sign up</a></td>
</tr>
<tr>
<td>epicmc.us:</td>
<td><a href="https://epicmc.us/bls.php">Login</a></td>
<td><a href="https://twitter.com/EPICMC_US">Info</a></td>
</tr>
<td>Desktop edition:</td>
<td><a href="desktop.html">Copy skin</a></td>
</tr>
</table>
<p style="font-size: 9pt">When uploading a skin, this site only store the skin itself, your username, and your IP address (for diagnostic purposes). This information is not shared with third parties. We do not store any passwords or e-mails submitted: they are just used temporarily to verify who you are.</p>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<title>BlockLauncher Skin Upload</title>
<style>
body {
font-family: Arial, sans-serif;
}
</style>
</head>
<body>
<h1>BlockLauncher Skin Upload</h1>
<p>You need an account from any of these servers in order to upload a skin.
This is to prevent other people from uploading a skin in your name.</p>
<p>Once you upload a skin, it will show up in all servers, not just the server you validated your identity with.</p>
<table>
<tr>
<td>Lifeboat:</td>
<td><a href="lbsg.html">Login</a></td>
<td><a href="https://play.google.com/store/apps/details?id=com.lifeboat">Sign up</a></td>
</tr>
<tr>
<td>epicmc.us:</td>
<td><a href="https://epicmc.us/bls.php">Login</a></td>
<td><a href="https://twitter.com/EPICMC_US">Info</a></td>
</tr>
<td>Desktop edition:</td>
<td><a href="desktop.html">Copy skin</a></td>
</tr>
</table>
<p style="font-size: 9pt">When uploading a skin, this site only store the skin itself, your username, and your IP address (for diagnostic purposes). This information is not shared with third parties. We do not store any passwords or e-mails submitted: they are just used temporarily to verify who you are.</p>
</body>
</html>
| Add clarification on where skins work | Add clarification on where skins work
| HTML | bsd-3-clause | zhuowei/blskins,zhuowei/blskins,zhuowei/blskins,zhuowei/blskins,zhuowei/blskins | html | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<title>BlockLauncher Skin Upload</title>
<style>
body {
font-family: Arial, sans-serif;
}
</style>
</head>
<body>
<h1>BlockLauncher Skin Upload</h1>
<p>You need an account from any of these servers in order to upload a skin.
This is to prevent other people from uploading a skin in your name.</p>
<table>
<tr>
<td>Lifeboat:</td>
<td><a href="lbsg.html">Login</a></td>
<td><a href="https://play.google.com/store/apps/details?id=com.lifeboat">Sign up</a></td>
</tr>
<tr>
<td>epicmc.us:</td>
<td><a href="https://epicmc.us/bls.php">Login</a></td>
<td><a href="https://twitter.com/EPICMC_US">Info</a></td>
</tr>
<td>Desktop edition:</td>
<td><a href="desktop.html">Copy skin</a></td>
</tr>
</table>
<p style="font-size: 9pt">When uploading a skin, this site only store the skin itself, your username, and your IP address (for diagnostic purposes). This information is not shared with third parties. We do not store any passwords or e-mails submitted: they are just used temporarily to verify who you are.</p>
</body>
</html>
## Instruction:
Add clarification on where skins work
## Code After:
<!DOCTYPE html>
<html>
<head>
<title>BlockLauncher Skin Upload</title>
<style>
body {
font-family: Arial, sans-serif;
}
</style>
</head>
<body>
<h1>BlockLauncher Skin Upload</h1>
<p>You need an account from any of these servers in order to upload a skin.
This is to prevent other people from uploading a skin in your name.</p>
<p>Once you upload a skin, it will show up in all servers, not just the server you validated your identity with.</p>
<table>
<tr>
<td>Lifeboat:</td>
<td><a href="lbsg.html">Login</a></td>
<td><a href="https://play.google.com/store/apps/details?id=com.lifeboat">Sign up</a></td>
</tr>
<tr>
<td>epicmc.us:</td>
<td><a href="https://epicmc.us/bls.php">Login</a></td>
<td><a href="https://twitter.com/EPICMC_US">Info</a></td>
</tr>
<td>Desktop edition:</td>
<td><a href="desktop.html">Copy skin</a></td>
</tr>
</table>
<p style="font-size: 9pt">When uploading a skin, this site only store the skin itself, your username, and your IP address (for diagnostic purposes). This information is not shared with third parties. We do not store any passwords or e-mails submitted: they are just used temporarily to verify who you are.</p>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<title>BlockLauncher Skin Upload</title>
<style>
body {
font-family: Arial, sans-serif;
}
</style>
</head>
<body>
<h1>BlockLauncher Skin Upload</h1>
<p>You need an account from any of these servers in order to upload a skin.
This is to prevent other people from uploading a skin in your name.</p>
+ <p>Once you upload a skin, it will show up in all servers, not just the server you validated your identity with.</p>
<table>
<tr>
<td>Lifeboat:</td>
<td><a href="lbsg.html">Login</a></td>
<td><a href="https://play.google.com/store/apps/details?id=com.lifeboat">Sign up</a></td>
</tr>
<tr>
<td>epicmc.us:</td>
<td><a href="https://epicmc.us/bls.php">Login</a></td>
<td><a href="https://twitter.com/EPICMC_US">Info</a></td>
</tr>
<td>Desktop edition:</td>
<td><a href="desktop.html">Copy skin</a></td>
</tr>
</table>
<p style="font-size: 9pt">When uploading a skin, this site only store the skin itself, your username, and your IP address (for diagnostic purposes). This information is not shared with third parties. We do not store any passwords or e-mails submitted: they are just used temporarily to verify who you are.</p>
</body>
</html> | 1 | 0.03125 | 1 | 0 |
cbae962b77b7277f5904279a5418a53e38148f2c | karspexet/show/models.py | karspexet/show/models.py | from django.db import models
import datetime
class Production(models.Model):
name = models.CharField(max_length=100)
description = models.TextField(blank=True)
def __str__(self):
return self.name
class Show(models.Model):
production = models.ForeignKey(Production, on_delete=models.PROTECT)
date = models.DateTimeField()
venue = models.ForeignKey('venue.Venue', on_delete=models.PROTECT)
@staticmethod
def upcoming():
return Show.objects.filter(date__gte=datetime.date.today())
def date_string(self):
return self.date.strftime("%Y-%m-%d %H:%M")
def __str__(self):
return self.production.name + " " + self.date_string()
class Meta:
ordering = ('date',)
| from django.db import models
import datetime
class Production(models.Model):
name = models.CharField(max_length=100)
description = models.TextField(blank=True)
def __str__(self):
return self.name
class Show(models.Model):
production = models.ForeignKey(Production, on_delete=models.PROTECT)
date = models.DateTimeField()
venue = models.ForeignKey('venue.Venue', on_delete=models.PROTECT)
@staticmethod
def upcoming():
return Show.objects.filter(date__gte=datetime.date.today())
@staticmethod
def ticket_coverage():
return Show.objects.raw("""
select show.id,
show.production_id,
show.venue_id,
venue.name as venue_name,
production.name as production_name,
show.date,
count(distinct(ticket.id)) as ticket_count,
count(distinct(seat.id)) as seat_count,
100 * (count(distinct(ticket.id))::float / count(distinct(seat.id))) as sales_percentage
from show_show show
left outer join ticket_ticket ticket on ticket.show_id = show.id
left join venue_venue venue on show.venue_id = venue.id
left join venue_seatinggroup sg on sg.venue_id = venue.id
left join venue_seat seat on sg.id = seat.group_id
left join show_production production on show.production_id = production.id
group by show.id, venue.name, production.name
order by show.date desc
""")
def date_string(self):
return self.date.strftime("%Y-%m-%d %H:%M")
def __str__(self):
return self.production.name + " " + self.date_string()
class Meta:
ordering = ('date',)
| Add Show.ticket_coverage() to get statistics on coverage | Add Show.ticket_coverage() to get statistics on coverage
Very left join, much SQL, wow.
| Python | mit | Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet | python | ## Code Before:
from django.db import models
import datetime
class Production(models.Model):
name = models.CharField(max_length=100)
description = models.TextField(blank=True)
def __str__(self):
return self.name
class Show(models.Model):
production = models.ForeignKey(Production, on_delete=models.PROTECT)
date = models.DateTimeField()
venue = models.ForeignKey('venue.Venue', on_delete=models.PROTECT)
@staticmethod
def upcoming():
return Show.objects.filter(date__gte=datetime.date.today())
def date_string(self):
return self.date.strftime("%Y-%m-%d %H:%M")
def __str__(self):
return self.production.name + " " + self.date_string()
class Meta:
ordering = ('date',)
## Instruction:
Add Show.ticket_coverage() to get statistics on coverage
Very left join, much SQL, wow.
## Code After:
from django.db import models
import datetime
class Production(models.Model):
name = models.CharField(max_length=100)
description = models.TextField(blank=True)
def __str__(self):
return self.name
class Show(models.Model):
production = models.ForeignKey(Production, on_delete=models.PROTECT)
date = models.DateTimeField()
venue = models.ForeignKey('venue.Venue', on_delete=models.PROTECT)
@staticmethod
def upcoming():
return Show.objects.filter(date__gte=datetime.date.today())
@staticmethod
def ticket_coverage():
return Show.objects.raw("""
select show.id,
show.production_id,
show.venue_id,
venue.name as venue_name,
production.name as production_name,
show.date,
count(distinct(ticket.id)) as ticket_count,
count(distinct(seat.id)) as seat_count,
100 * (count(distinct(ticket.id))::float / count(distinct(seat.id))) as sales_percentage
from show_show show
left outer join ticket_ticket ticket on ticket.show_id = show.id
left join venue_venue venue on show.venue_id = venue.id
left join venue_seatinggroup sg on sg.venue_id = venue.id
left join venue_seat seat on sg.id = seat.group_id
left join show_production production on show.production_id = production.id
group by show.id, venue.name, production.name
order by show.date desc
""")
def date_string(self):
return self.date.strftime("%Y-%m-%d %H:%M")
def __str__(self):
return self.production.name + " " + self.date_string()
class Meta:
ordering = ('date',)
| from django.db import models
import datetime
class Production(models.Model):
name = models.CharField(max_length=100)
description = models.TextField(blank=True)
def __str__(self):
return self.name
class Show(models.Model):
production = models.ForeignKey(Production, on_delete=models.PROTECT)
date = models.DateTimeField()
venue = models.ForeignKey('venue.Venue', on_delete=models.PROTECT)
@staticmethod
def upcoming():
return Show.objects.filter(date__gte=datetime.date.today())
+ @staticmethod
+ def ticket_coverage():
+ return Show.objects.raw("""
+ select show.id,
+ show.production_id,
+ show.venue_id,
+ venue.name as venue_name,
+ production.name as production_name,
+ show.date,
+ count(distinct(ticket.id)) as ticket_count,
+ count(distinct(seat.id)) as seat_count,
+ 100 * (count(distinct(ticket.id))::float / count(distinct(seat.id))) as sales_percentage
+ from show_show show
+ left outer join ticket_ticket ticket on ticket.show_id = show.id
+ left join venue_venue venue on show.venue_id = venue.id
+ left join venue_seatinggroup sg on sg.venue_id = venue.id
+ left join venue_seat seat on sg.id = seat.group_id
+ left join show_production production on show.production_id = production.id
+ group by show.id, venue.name, production.name
+ order by show.date desc
+ """)
+
def date_string(self):
return self.date.strftime("%Y-%m-%d %H:%M")
def __str__(self):
return self.production.name + " " + self.date_string()
class Meta:
ordering = ('date',) | 22 | 0.758621 | 22 | 0 |
f694d8ac5b83c5e0ccc25ab2aef44dd8427132ba | client/templates/registerWizard/steps/review/review.js | client/templates/registerWizard/steps/review/review.js | Template.wizardReview.onCreated(function () {
// Get reference to template instance
const instance = this;
// Get form data as instance variable
instance.registration = instance.data.wizard.mergedData();
});
Template.wizardReview.helpers({
'registration': function () {
// Get reference to template instance
const instance = Template.instance();
// Get registration from template instance
return instance.registration;
},
'accommodationsFee': function () {
// Get reference to template instance
const instance = Template.instance();
// Get registration data
const registration = instance.registration;
// Adjust attributes of registration data to match accommodations fee function
registration.type = registration.registrationType;
registration.ageGroup = calculateAgeGroup(registration.age);
// Calculate accommodations fee
const accommodationsFee = calculateAccommodationsFee(registration);
return accommodationsFee;
}
});
| Template.wizardReview.onCreated(function () {
// Get reference to template instance
const instance = this;
// Get form data as instance variable
instance.registration = instance.data.wizard.mergedData();
});
Template.wizardReview.helpers({
'registration': function () {
// Get reference to template instance
const instance = Template.instance();
// Get registration from template instance
return instance.registration;
},
'accommodationsFee': function () {
// Get reference to template instance
const instance = Template.instance();
// Get registration data
const registration = instance.registration;
// Adjust attributes of registration data to match accommodations fee function
registration.type = registration.registrationType;
registration.ageGroup = calculateAgeGroup(registration.age);
// Calculate accommodations fee
const accommodationsFee = calculateAccommodationsFee(registration);
return accommodationsFee;
},
'firstTimeAttenderDiscount': function () {
// Get reference to template instance
const instance = Template.instance();
// Get registration
const registration = instance.registration;
// Calculate first time attender discount
if (registration.firstTimeAttender) {
return firstTimeAttenderDiscount;
}
}
});
| Add first time attender helper | Add first time attender helper
| JavaScript | agpl-3.0 | quaker-io/pym-2015,quaker-io/pym-online-registration,quaker-io/pym-online-registration,quaker-io/pym-2015 | javascript | ## Code Before:
Template.wizardReview.onCreated(function () {
// Get reference to template instance
const instance = this;
// Get form data as instance variable
instance.registration = instance.data.wizard.mergedData();
});
Template.wizardReview.helpers({
'registration': function () {
// Get reference to template instance
const instance = Template.instance();
// Get registration from template instance
return instance.registration;
},
'accommodationsFee': function () {
// Get reference to template instance
const instance = Template.instance();
// Get registration data
const registration = instance.registration;
// Adjust attributes of registration data to match accommodations fee function
registration.type = registration.registrationType;
registration.ageGroup = calculateAgeGroup(registration.age);
// Calculate accommodations fee
const accommodationsFee = calculateAccommodationsFee(registration);
return accommodationsFee;
}
});
## Instruction:
Add first time attender helper
## Code After:
Template.wizardReview.onCreated(function () {
// Get reference to template instance
const instance = this;
// Get form data as instance variable
instance.registration = instance.data.wizard.mergedData();
});
Template.wizardReview.helpers({
'registration': function () {
// Get reference to template instance
const instance = Template.instance();
// Get registration from template instance
return instance.registration;
},
'accommodationsFee': function () {
// Get reference to template instance
const instance = Template.instance();
// Get registration data
const registration = instance.registration;
// Adjust attributes of registration data to match accommodations fee function
registration.type = registration.registrationType;
registration.ageGroup = calculateAgeGroup(registration.age);
// Calculate accommodations fee
const accommodationsFee = calculateAccommodationsFee(registration);
return accommodationsFee;
},
'firstTimeAttenderDiscount': function () {
// Get reference to template instance
const instance = Template.instance();
// Get registration
const registration = instance.registration;
// Calculate first time attender discount
if (registration.firstTimeAttender) {
return firstTimeAttenderDiscount;
}
}
});
| Template.wizardReview.onCreated(function () {
// Get reference to template instance
const instance = this;
// Get form data as instance variable
instance.registration = instance.data.wizard.mergedData();
});
Template.wizardReview.helpers({
'registration': function () {
// Get reference to template instance
const instance = Template.instance();
// Get registration from template instance
return instance.registration;
},
'accommodationsFee': function () {
// Get reference to template instance
const instance = Template.instance();
// Get registration data
const registration = instance.registration;
// Adjust attributes of registration data to match accommodations fee function
registration.type = registration.registrationType;
registration.ageGroup = calculateAgeGroup(registration.age);
// Calculate accommodations fee
const accommodationsFee = calculateAccommodationsFee(registration);
return accommodationsFee;
+ },
+ 'firstTimeAttenderDiscount': function () {
+ // Get reference to template instance
+ const instance = Template.instance();
+
+ // Get registration
+ const registration = instance.registration;
+
+ // Calculate first time attender discount
+ if (registration.firstTimeAttender) {
+ return firstTimeAttenderDiscount;
+ }
}
}); | 12 | 0.363636 | 12 | 0 |
2fd88af1bba32c3a57a23096880d1e816918123e | spec/factories/plans_factory.rb | spec/factories/plans_factory.rb | FactoryGirl.define do
factory :plan, class: TaskManager::Plan do
name 'A test plan'
data {{ x: ['A', 'B', 'C'], y: [1, 2, 3] }}
last_task_created_at 1.day.ago
autocompletable false
end
end
| FactoryGirl.define do
factory :plan, class: TaskManager::Plan do
name 'A test plan'
plan_type :daily
data {{ x: ['A', 'B', 'C'], y: [1, 2, 3] }}
last_task_created_at 1.day.ago
autocompletable false
end
end
| Set default type of plan | Set default type of plan
| Ruby | mit | menglifang/task-manager,menglifang/task-manager | ruby | ## Code Before:
FactoryGirl.define do
factory :plan, class: TaskManager::Plan do
name 'A test plan'
data {{ x: ['A', 'B', 'C'], y: [1, 2, 3] }}
last_task_created_at 1.day.ago
autocompletable false
end
end
## Instruction:
Set default type of plan
## Code After:
FactoryGirl.define do
factory :plan, class: TaskManager::Plan do
name 'A test plan'
plan_type :daily
data {{ x: ['A', 'B', 'C'], y: [1, 2, 3] }}
last_task_created_at 1.day.ago
autocompletable false
end
end
| FactoryGirl.define do
factory :plan, class: TaskManager::Plan do
name 'A test plan'
+ plan_type :daily
data {{ x: ['A', 'B', 'C'], y: [1, 2, 3] }}
last_task_created_at 1.day.ago
autocompletable false
end
end | 1 | 0.125 | 1 | 0 |
df0f2822e94f3476fd795e4c95a71d19947abd17 | app/controllers/teams_controller.rb | app/controllers/teams_controller.rb | class TeamsController < ApplicationController
before_action :set_team, only: [:show, :edit, :update]
def index
@teams = BusinessGroup.all
authorize @teams.first
end
def show
authorize @team
@children = @team.children
end
def edit
authorize @team
end
def update
authorize @team
if @team.update(team_params)
flash[:notice] = 'Team details updated'
redirect_to team_path(@team.parent)
else
render :edit
end
end
def new
klass = case params[:type]
when 'bu'
BusinessUnit
when 'dir'
Directorate
when 'bg'
BusinessGroup
else
raise ArgumentError.new('Invalid team type parameter')
end
@team = klass.new
@team.team_lead = ''
@team.parent_id = params[:parent_id].to_i
end
def create
authorize Team.first
@team = BusinessUnit.new(new_team_params)
if @team.save
flash[:notice] = 'Team created'
redirect_to team_path(@team.parent_id)
else
render :new
end
end
def team_params
params.require(:team).permit(
:name,
:email,
:team_lead
)
end
def new_team_params
params.require(:team).permit(
:name,
:email,
:team_lead,
:parent_id
)
end
private
def set_team
@team = Team.find(params[:id])
end
end
| class TeamsController < ApplicationController
before_action :set_team, only: [:show, :edit, :update]
def index
@teams = BusinessGroup.all
authorize @teams.first
end
def show
authorize @team
@children = @team.children
end
def edit
authorize @team
end
def update
authorize @team
if @team.update(team_params)
flash[:notice] = 'Team details updated'
redirect_to team_path(@team.parent)
else
render :edit
end
end
def new
klass = case params[:type]
when 'bu'
BusinessUnit
when 'dir'
Directorate
when 'bg'
BusinessGroup
else
raise ArgumentError.new('Invalid team type parameter')
end
@team = klass.new
@team.team_lead = ''
@team.parent_id = params[:parent_id].to_i
end
def create
authorize Team.first
@team = BusinessUnit.new(new_team_params)
@team.role = 'responder'
if @team.save
flash[:notice] = 'Team created'
redirect_to team_path(@team.parent_id)
else
render :new
end
end
def team_params
params.require(:team).permit(
:name,
:email,
:team_lead
)
end
def new_team_params
params.require(:team).permit(
:name,
:email,
:team_lead,
:parent_id
)
end
private
def set_team
@team = Team.find(params[:id])
end
end
| Add Team property responder when creating Business Unit | Add Team property responder when creating Business Unit
| Ruby | mit | ministryofjustice/correspondence_tool_staff,ministryofjustice/correspondence_tool_staff,ministryofjustice/correspondence_tool_staff,ministryofjustice/correspondence_tool_staff,ministryofjustice/correspondence_tool_staff | ruby | ## Code Before:
class TeamsController < ApplicationController
before_action :set_team, only: [:show, :edit, :update]
def index
@teams = BusinessGroup.all
authorize @teams.first
end
def show
authorize @team
@children = @team.children
end
def edit
authorize @team
end
def update
authorize @team
if @team.update(team_params)
flash[:notice] = 'Team details updated'
redirect_to team_path(@team.parent)
else
render :edit
end
end
def new
klass = case params[:type]
when 'bu'
BusinessUnit
when 'dir'
Directorate
when 'bg'
BusinessGroup
else
raise ArgumentError.new('Invalid team type parameter')
end
@team = klass.new
@team.team_lead = ''
@team.parent_id = params[:parent_id].to_i
end
def create
authorize Team.first
@team = BusinessUnit.new(new_team_params)
if @team.save
flash[:notice] = 'Team created'
redirect_to team_path(@team.parent_id)
else
render :new
end
end
def team_params
params.require(:team).permit(
:name,
:email,
:team_lead
)
end
def new_team_params
params.require(:team).permit(
:name,
:email,
:team_lead,
:parent_id
)
end
private
def set_team
@team = Team.find(params[:id])
end
end
## Instruction:
Add Team property responder when creating Business Unit
## Code After:
class TeamsController < ApplicationController
before_action :set_team, only: [:show, :edit, :update]
def index
@teams = BusinessGroup.all
authorize @teams.first
end
def show
authorize @team
@children = @team.children
end
def edit
authorize @team
end
def update
authorize @team
if @team.update(team_params)
flash[:notice] = 'Team details updated'
redirect_to team_path(@team.parent)
else
render :edit
end
end
def new
klass = case params[:type]
when 'bu'
BusinessUnit
when 'dir'
Directorate
when 'bg'
BusinessGroup
else
raise ArgumentError.new('Invalid team type parameter')
end
@team = klass.new
@team.team_lead = ''
@team.parent_id = params[:parent_id].to_i
end
def create
authorize Team.first
@team = BusinessUnit.new(new_team_params)
@team.role = 'responder'
if @team.save
flash[:notice] = 'Team created'
redirect_to team_path(@team.parent_id)
else
render :new
end
end
def team_params
params.require(:team).permit(
:name,
:email,
:team_lead
)
end
def new_team_params
params.require(:team).permit(
:name,
:email,
:team_lead,
:parent_id
)
end
private
def set_team
@team = Team.find(params[:id])
end
end
| class TeamsController < ApplicationController
before_action :set_team, only: [:show, :edit, :update]
def index
@teams = BusinessGroup.all
authorize @teams.first
end
def show
authorize @team
@children = @team.children
end
def edit
authorize @team
end
def update
authorize @team
if @team.update(team_params)
flash[:notice] = 'Team details updated'
redirect_to team_path(@team.parent)
else
render :edit
end
end
def new
klass = case params[:type]
when 'bu'
BusinessUnit
when 'dir'
Directorate
when 'bg'
BusinessGroup
else
raise ArgumentError.new('Invalid team type parameter')
end
@team = klass.new
@team.team_lead = ''
@team.parent_id = params[:parent_id].to_i
end
def create
authorize Team.first
@team = BusinessUnit.new(new_team_params)
+ @team.role = 'responder'
if @team.save
flash[:notice] = 'Team created'
redirect_to team_path(@team.parent_id)
else
render :new
end
end
def team_params
params.require(:team).permit(
:name,
:email,
:team_lead
)
end
def new_team_params
params.require(:team).permit(
:name,
:email,
:team_lead,
:parent_id
)
end
private
def set_team
@team = Team.find(params[:id])
end
end | 1 | 0.012346 | 1 | 0 |
742ef7aff537692d2d09bdbe82a1841a1f612df8 | lib/jeera.rb | lib/jeera.rb | require_relative '../../thor/lib/thor'
require 'debugger'
# require 'thor'
require_relative 'jeera/version'
require_relative 'jeera/config'
require_relative 'jeera/client'
require_relative 'jeera/util'
module Jeera
module Commands; end
# Set client instance
@client = Client.instance
class << self
attr_reader :client
end
end
# Get command definitions
Dir["#{File.dirname(__FILE__)}/jeera/commands/*.rb"].each { |file| require file }
require_relative 'jeera/shell'
| require 'thor'
require_relative 'jeera/version'
require_relative 'jeera/config'
require_relative 'jeera/client'
require_relative 'jeera/util'
module Jeera
module Commands; end
# Set client instance
@client = Client.instance
class << self
attr_reader :client
end
end
# Get command definitions
Dir["#{File.dirname(__FILE__)}/jeera/commands/*.rb"].each { |file| require file }
require_relative 'jeera/shell'
| Undo relative path to thor | Undo relative path to thor
| Ruby | mit | sethbro/jeera | ruby | ## Code Before:
require_relative '../../thor/lib/thor'
require 'debugger'
# require 'thor'
require_relative 'jeera/version'
require_relative 'jeera/config'
require_relative 'jeera/client'
require_relative 'jeera/util'
module Jeera
module Commands; end
# Set client instance
@client = Client.instance
class << self
attr_reader :client
end
end
# Get command definitions
Dir["#{File.dirname(__FILE__)}/jeera/commands/*.rb"].each { |file| require file }
require_relative 'jeera/shell'
## Instruction:
Undo relative path to thor
## Code After:
require 'thor'
require_relative 'jeera/version'
require_relative 'jeera/config'
require_relative 'jeera/client'
require_relative 'jeera/util'
module Jeera
module Commands; end
# Set client instance
@client = Client.instance
class << self
attr_reader :client
end
end
# Get command definitions
Dir["#{File.dirname(__FILE__)}/jeera/commands/*.rb"].each { |file| require file }
require_relative 'jeera/shell'
| - require_relative '../../thor/lib/thor'
- require 'debugger'
- # require 'thor'
? --
+ require 'thor'
require_relative 'jeera/version'
require_relative 'jeera/config'
require_relative 'jeera/client'
require_relative 'jeera/util'
module Jeera
module Commands; end
# Set client instance
@client = Client.instance
class << self
attr_reader :client
end
end
# Get command definitions
Dir["#{File.dirname(__FILE__)}/jeera/commands/*.rb"].each { |file| require file }
require_relative 'jeera/shell' | 4 | 0.166667 | 1 | 3 |
fe92323dfa1067d552abefa60910e758500f0920 | virtool/handlers/files.py | virtool/handlers/files.py | import virtool.file
from virtool.handlers.utils import json_response
async def find(req):
db = req.app["db"]
cursor = db.files.find({"eof": True}, virtool.file.LIST_PROJECTION)
found_count = await cursor.count()
documents = [virtool.file.processor(d) for d in await cursor.to_list(15)]
return json_response({
"documents": documents,
"found_count": found_count
})
| import os
import virtool.file
import virtool.utils
from virtool.handlers.utils import json_response, not_found
async def find(req):
db = req.app["db"]
cursor = db.files.find({"ready": True}, virtool.file.LIST_PROJECTION)
found_count = await cursor.count()
documents = [virtool.file.processor(d) for d in await cursor.to_list(15)]
return json_response({
"documents": documents,
"found_count": found_count
})
async def remove(req):
file_id = req.match_info["file_id"]
file_path = os.path.join(req.app["settings"].get("data_path"), "files", file_id)
delete_result = await req.app["db"].files.delete_one({"_id": file_id})
virtool.utils.rm(file_path)
if delete_result.deleted_count == 0:
return not_found("Document does not exist")
await req.app["dispatcher"].dispatch("files", "remove", [file_id])
return json_response({
"file_id": file_id,
"removed": True
})
| Add uploaded file removal endpoint | Add uploaded file removal endpoint
| Python | mit | igboyes/virtool,virtool/virtool,virtool/virtool,igboyes/virtool | python | ## Code Before:
import virtool.file
from virtool.handlers.utils import json_response
async def find(req):
db = req.app["db"]
cursor = db.files.find({"eof": True}, virtool.file.LIST_PROJECTION)
found_count = await cursor.count()
documents = [virtool.file.processor(d) for d in await cursor.to_list(15)]
return json_response({
"documents": documents,
"found_count": found_count
})
## Instruction:
Add uploaded file removal endpoint
## Code After:
import os
import virtool.file
import virtool.utils
from virtool.handlers.utils import json_response, not_found
async def find(req):
db = req.app["db"]
cursor = db.files.find({"ready": True}, virtool.file.LIST_PROJECTION)
found_count = await cursor.count()
documents = [virtool.file.processor(d) for d in await cursor.to_list(15)]
return json_response({
"documents": documents,
"found_count": found_count
})
async def remove(req):
file_id = req.match_info["file_id"]
file_path = os.path.join(req.app["settings"].get("data_path"), "files", file_id)
delete_result = await req.app["db"].files.delete_one({"_id": file_id})
virtool.utils.rm(file_path)
if delete_result.deleted_count == 0:
return not_found("Document does not exist")
await req.app["dispatcher"].dispatch("files", "remove", [file_id])
return json_response({
"file_id": file_id,
"removed": True
})
| + import os
+
import virtool.file
+ import virtool.utils
- from virtool.handlers.utils import json_response
+ from virtool.handlers.utils import json_response, not_found
? +++++++++++
async def find(req):
db = req.app["db"]
- cursor = db.files.find({"eof": True}, virtool.file.LIST_PROJECTION)
? ^^
+ cursor = db.files.find({"ready": True}, virtool.file.LIST_PROJECTION)
? + ^^^
found_count = await cursor.count()
documents = [virtool.file.processor(d) for d in await cursor.to_list(15)]
return json_response({
"documents": documents,
"found_count": found_count
})
+
+
+ async def remove(req):
+ file_id = req.match_info["file_id"]
+
+ file_path = os.path.join(req.app["settings"].get("data_path"), "files", file_id)
+
+ delete_result = await req.app["db"].files.delete_one({"_id": file_id})
+
+ virtool.utils.rm(file_path)
+
+ if delete_result.deleted_count == 0:
+ return not_found("Document does not exist")
+
+ await req.app["dispatcher"].dispatch("files", "remove", [file_id])
+
+ return json_response({
+ "file_id": file_id,
+ "removed": True
+ }) | 27 | 1.588235 | 25 | 2 |
6bd45d264970d54b40f2fce684d302cf234c0805 | .travis.yml | .travis.yml | language: go
go:
- 1.6.2
- tip
env:
- GIMME_OS=linux GIMME_ARCH=amd64
- GIMME_OS=darwin GIMME_ARCH=amd64
- GIMME_OS=windows GIMME_ARCH=amd64
script:
- make build
notifications:
slack: miracloud:5r69ZAasA5mX50aig27LVKrs
| language: go
go:
- 1.6.2
- tip
os:
- linux
- osx
script:
- make build
notifications:
slack: miracloud:5r69ZAasA5mX50aig27LVKrs
| Fix Travis build and test | Fix Travis build and test
| YAML | apache-2.0 | oleksandr-minakov/northshore,oleksandr-minakov/northshore,oleksandr-minakov/northshore,psumkin/northshore,psumkin/northshore,psumkin/northshore,oleksandr-minakov/northshore,psumkin/northshore,psumkin/northshore,oleksandr-minakov/northshore | yaml | ## Code Before:
language: go
go:
- 1.6.2
- tip
env:
- GIMME_OS=linux GIMME_ARCH=amd64
- GIMME_OS=darwin GIMME_ARCH=amd64
- GIMME_OS=windows GIMME_ARCH=amd64
script:
- make build
notifications:
slack: miracloud:5r69ZAasA5mX50aig27LVKrs
## Instruction:
Fix Travis build and test
## Code After:
language: go
go:
- 1.6.2
- tip
os:
- linux
- osx
script:
- make build
notifications:
slack: miracloud:5r69ZAasA5mX50aig27LVKrs
| language: go
go:
- 1.6.2
- tip
+ os:
+ - linux
+ - osx
- env:
- - GIMME_OS=linux GIMME_ARCH=amd64
- - GIMME_OS=darwin GIMME_ARCH=amd64
- - GIMME_OS=windows GIMME_ARCH=amd64
script:
- make build
notifications:
slack: miracloud:5r69ZAasA5mX50aig27LVKrs | 7 | 0.4375 | 3 | 4 |
2f9d9413f488bb6911f65b1c997b7b03cfc81878 | spec/ubuntu/apt-get_spec.rb | spec/ubuntu/apt-get_spec.rb | require 'spec_helper'
# Testing basic apt-get commands
describe command('apt-get -y update') do
its(:exit_status) { should eq 0 }
end
describe command('apt-get -y upgrade') do
its(:exit_status) { should eq 0 }
end
describe command('apt-get -y install apg') do
its(:exit_status) { should eq 0 }
end
describe command('apt-get -y remove apg') do
its(:exit_status) { should eq 0 }
end
| require 'spec_helper'
# Testing basic apt-get commands
describe command('apt-get -y update') do
its(:exit_status) { should eq 0 }
end
describe command('apt-get -y upgrade') do
its(:exit_status) { should eq 0 }
end
describe command('apt-get -y install apg') do
its(:exit_status) { should eq 0 }
end
describe command('apt-get -y remove apg') do
its(:exit_status) { should eq 0 }
end
# Make sure we apt pin udev in Ubuntu 16.XX and 17.XX
if property[:name] =~ /Ubuntu 16./
describe file('/etc/apt/preferences.d/udev') do
it { should be_file }
its(:content) { should match /Package: udev/ }
its(:content) { should match /Pin: release */ }
its(:content) { should match /Pin-Priority: -1/ }
end
end
if property[:name] =~ /Ubuntu 17./
describe file('/etc/apt/preferences.d/udev') do
it { should be_file }
its(:content) { should match /Package: udev/ }
its(:content) { should match /Pin: release */ }
its(:content) { should match /Pin-Priority: -1/ }
end
end
| Test for apt pinning of udev in Ubuntu 16.xx and 17.xx | Test for apt pinning of udev in Ubuntu 16.xx and 17.xx
Adding 17.XX to be preemptive.
| Ruby | mpl-2.0 | joyent/lx-brand-image-tests,joyent/lx-brand-image-tests | ruby | ## Code Before:
require 'spec_helper'
# Testing basic apt-get commands
describe command('apt-get -y update') do
its(:exit_status) { should eq 0 }
end
describe command('apt-get -y upgrade') do
its(:exit_status) { should eq 0 }
end
describe command('apt-get -y install apg') do
its(:exit_status) { should eq 0 }
end
describe command('apt-get -y remove apg') do
its(:exit_status) { should eq 0 }
end
## Instruction:
Test for apt pinning of udev in Ubuntu 16.xx and 17.xx
Adding 17.XX to be preemptive.
## Code After:
require 'spec_helper'
# Testing basic apt-get commands
describe command('apt-get -y update') do
its(:exit_status) { should eq 0 }
end
describe command('apt-get -y upgrade') do
its(:exit_status) { should eq 0 }
end
describe command('apt-get -y install apg') do
its(:exit_status) { should eq 0 }
end
describe command('apt-get -y remove apg') do
its(:exit_status) { should eq 0 }
end
# Make sure we apt pin udev in Ubuntu 16.XX and 17.XX
if property[:name] =~ /Ubuntu 16./
describe file('/etc/apt/preferences.d/udev') do
it { should be_file }
its(:content) { should match /Package: udev/ }
its(:content) { should match /Pin: release */ }
its(:content) { should match /Pin-Priority: -1/ }
end
end
if property[:name] =~ /Ubuntu 17./
describe file('/etc/apt/preferences.d/udev') do
it { should be_file }
its(:content) { should match /Package: udev/ }
its(:content) { should match /Pin: release */ }
its(:content) { should match /Pin-Priority: -1/ }
end
end
| require 'spec_helper'
# Testing basic apt-get commands
describe command('apt-get -y update') do
its(:exit_status) { should eq 0 }
end
describe command('apt-get -y upgrade') do
its(:exit_status) { should eq 0 }
end
describe command('apt-get -y install apg') do
its(:exit_status) { should eq 0 }
end
describe command('apt-get -y remove apg') do
its(:exit_status) { should eq 0 }
end
+
+ # Make sure we apt pin udev in Ubuntu 16.XX and 17.XX
+ if property[:name] =~ /Ubuntu 16./
+ describe file('/etc/apt/preferences.d/udev') do
+ it { should be_file }
+ its(:content) { should match /Package: udev/ }
+ its(:content) { should match /Pin: release */ }
+ its(:content) { should match /Pin-Priority: -1/ }
+ end
+ end
+
+ if property[:name] =~ /Ubuntu 17./
+ describe file('/etc/apt/preferences.d/udev') do
+ it { should be_file }
+ its(:content) { should match /Package: udev/ }
+ its(:content) { should match /Pin: release */ }
+ its(:content) { should match /Pin-Priority: -1/ }
+ end
+ end | 19 | 1.055556 | 19 | 0 |
9698eab88c20dd01d4beafa9786eddbed78e4577 | app/client/views/activities/form/form.html | app/client/views/activities/form/form.html | <template name="activityForm">
{{# autoForm id="activityForm" type=formType collection="Activities" doc=activity }}
<div class="modal-body">
<label for="activityTypeId">
{{_ 'activities.residentIds.label'}}
</label>
{{> afFieldInput
name="residentIds"
multiple=true
options=residentsSelectOptions
value=residentIds
}}
<label for="activityTypeId">
{{_ 'activities.activityTypeId.label'}}
</label>
{{> afFieldInput name="activityTypeId" options=activityTypeIdOptions }}
<label for="activityDate">
{{_ 'activities.activityDate.label'}}
</label>
{{> afFieldInput name="activityDate" buttonClasses="fa fa-calendar" }}
<label for="duration">
{{_ 'activities.duration.label'}}
</label>
{{> afFieldInput name="duration"}}
<label for="facilitatorRoleId">
{{_ 'activities.facilitatorRoleId.label'}}
</label>
{{> afFieldInput name="facilitatorRoleId" options=facilitatorRoleIdOptions }}
</div>
<button type="submit" class="btn btn-success">
{{_ "activityForm-save" }}
</button>
<button type="button" class="btn btn-danger" data-dismiss="modal">
{{_ "activityForm-cancel" }}
</button>
{{/ autoForm }}
</template>
| <template name="activityForm">
{{# autoForm id="activityForm" type=formType collection="Activities" doc=activity }}
<div class="modal-body">
<label for="activityTypeId">
{{_ 'activities.residentIds.label'}}
</label>
{{> afFieldInput
name="residentIds"
multiple=true
options=residentsSelectOptions
value=residentIds
}}
<label for="activityTypeId">
{{_ 'activities.activityTypeId.label'}}
</label>
{{> afFieldInput name="activityTypeId" options=activityTypeIdOptions }}
<label for="activityDate">
{{_ 'activities.activityDate.label'}}
</label>
{{> afFieldInput name="activityDate" buttonClasses="fa fa-calendar" id="activityDate" }}
<label for="duration">
{{_ 'activities.duration.label'}}
</label>
{{> afFieldInput name="duration"}}
<label for="facilitatorRoleId">
{{_ 'activities.facilitatorRoleId.label'}}
</label>
{{> afFieldInput name="facilitatorRoleId" options=facilitatorRoleIdOptions }}
</div>
<button type="submit" class="btn btn-success">
{{_ "activityForm-save" }}
</button>
<button type="button" class="btn btn-danger" data-dismiss="modal">
{{_ "activityForm-cancel" }}
</button>
{{/ autoForm }}
</template>
| Add id to activityDate field | Add id to activityDate field
| HTML | agpl-3.0 | GeriLife/wellbeing,GeriLife/wellbeing,brylie/juhani-wellbeing,GeriLife/wellbeing,brylie/juhani-wellbeing,brylie/juhani-wellbeing,brylie/juhani-wellbeing,GeriLife/wellbeing | html | ## Code Before:
<template name="activityForm">
{{# autoForm id="activityForm" type=formType collection="Activities" doc=activity }}
<div class="modal-body">
<label for="activityTypeId">
{{_ 'activities.residentIds.label'}}
</label>
{{> afFieldInput
name="residentIds"
multiple=true
options=residentsSelectOptions
value=residentIds
}}
<label for="activityTypeId">
{{_ 'activities.activityTypeId.label'}}
</label>
{{> afFieldInput name="activityTypeId" options=activityTypeIdOptions }}
<label for="activityDate">
{{_ 'activities.activityDate.label'}}
</label>
{{> afFieldInput name="activityDate" buttonClasses="fa fa-calendar" }}
<label for="duration">
{{_ 'activities.duration.label'}}
</label>
{{> afFieldInput name="duration"}}
<label for="facilitatorRoleId">
{{_ 'activities.facilitatorRoleId.label'}}
</label>
{{> afFieldInput name="facilitatorRoleId" options=facilitatorRoleIdOptions }}
</div>
<button type="submit" class="btn btn-success">
{{_ "activityForm-save" }}
</button>
<button type="button" class="btn btn-danger" data-dismiss="modal">
{{_ "activityForm-cancel" }}
</button>
{{/ autoForm }}
</template>
## Instruction:
Add id to activityDate field
## Code After:
<template name="activityForm">
{{# autoForm id="activityForm" type=formType collection="Activities" doc=activity }}
<div class="modal-body">
<label for="activityTypeId">
{{_ 'activities.residentIds.label'}}
</label>
{{> afFieldInput
name="residentIds"
multiple=true
options=residentsSelectOptions
value=residentIds
}}
<label for="activityTypeId">
{{_ 'activities.activityTypeId.label'}}
</label>
{{> afFieldInput name="activityTypeId" options=activityTypeIdOptions }}
<label for="activityDate">
{{_ 'activities.activityDate.label'}}
</label>
{{> afFieldInput name="activityDate" buttonClasses="fa fa-calendar" id="activityDate" }}
<label for="duration">
{{_ 'activities.duration.label'}}
</label>
{{> afFieldInput name="duration"}}
<label for="facilitatorRoleId">
{{_ 'activities.facilitatorRoleId.label'}}
</label>
{{> afFieldInput name="facilitatorRoleId" options=facilitatorRoleIdOptions }}
</div>
<button type="submit" class="btn btn-success">
{{_ "activityForm-save" }}
</button>
<button type="button" class="btn btn-danger" data-dismiss="modal">
{{_ "activityForm-cancel" }}
</button>
{{/ autoForm }}
</template>
| <template name="activityForm">
{{# autoForm id="activityForm" type=formType collection="Activities" doc=activity }}
<div class="modal-body">
<label for="activityTypeId">
{{_ 'activities.residentIds.label'}}
</label>
{{> afFieldInput
name="residentIds"
multiple=true
options=residentsSelectOptions
value=residentIds
}}
<label for="activityTypeId">
{{_ 'activities.activityTypeId.label'}}
</label>
{{> afFieldInput name="activityTypeId" options=activityTypeIdOptions }}
<label for="activityDate">
{{_ 'activities.activityDate.label'}}
</label>
- {{> afFieldInput name="activityDate" buttonClasses="fa fa-calendar" }}
+ {{> afFieldInput name="activityDate" buttonClasses="fa fa-calendar" id="activityDate" }}
? ++++++++++++++++++
<label for="duration">
{{_ 'activities.duration.label'}}
</label>
{{> afFieldInput name="duration"}}
<label for="facilitatorRoleId">
{{_ 'activities.facilitatorRoleId.label'}}
</label>
{{> afFieldInput name="facilitatorRoleId" options=facilitatorRoleIdOptions }}
</div>
<button type="submit" class="btn btn-success">
{{_ "activityForm-save" }}
</button>
<button type="button" class="btn btn-danger" data-dismiss="modal">
{{_ "activityForm-cancel" }}
</button>
{{/ autoForm }}
</template> | 2 | 0.047619 | 1 | 1 |
84423a9bf90a2aece5b04952cd0fa147a99d5a77 | lib/grocer/mobile_device_management_notification.rb | lib/grocer/mobile_device_management_notification.rb | require 'grocer/notification'
module Grocer
# Public: A specialized form of a Grocer::Notification which only requires a
# `push_magic` and `device_token` to be present in the payload.
#
# Examples
#
# Grocer::PassbookNotification.new(device_token: '...', push_magic: '...')
class MobileDeviceManagementNotification < Notification
attr_accessor :push_magic
private
def payload_hash
{ mdm: push_magic }
end
def validate_payload
fail NoPayloadError unless push_magic
fail InvalidFormatError if alert || badge || custom
fail PayloadTooLargeError if payload_too_large?
end
end
end
| require 'grocer/notification'
module Grocer
# Public: A specialized form of a Grocer::Notification which only requires a
# `push_magic` and `device_token` to be present in the payload.
#
# Examples
#
# Grocer::MobileDeviceManagementNotification.new(device_token: '...', push_magic: '...')
class MobileDeviceManagementNotification < Notification
attr_accessor :push_magic
private
def payload_hash
{ mdm: push_magic }
end
def validate_payload
fail NoPayloadError unless push_magic
fail InvalidFormatError if alert || badge || custom
fail PayloadTooLargeError if payload_too_large?
end
end
end
| Fix misnamed example in documentation | Fix misnamed example in documentation
| Ruby | mit | grocer/grocer,dfried/grocer,rockarloz/grocer,utx-tex/grocer,RobotsAndPencils/grocer,ping4/grocer | ruby | ## Code Before:
require 'grocer/notification'
module Grocer
# Public: A specialized form of a Grocer::Notification which only requires a
# `push_magic` and `device_token` to be present in the payload.
#
# Examples
#
# Grocer::PassbookNotification.new(device_token: '...', push_magic: '...')
class MobileDeviceManagementNotification < Notification
attr_accessor :push_magic
private
def payload_hash
{ mdm: push_magic }
end
def validate_payload
fail NoPayloadError unless push_magic
fail InvalidFormatError if alert || badge || custom
fail PayloadTooLargeError if payload_too_large?
end
end
end
## Instruction:
Fix misnamed example in documentation
## Code After:
require 'grocer/notification'
module Grocer
# Public: A specialized form of a Grocer::Notification which only requires a
# `push_magic` and `device_token` to be present in the payload.
#
# Examples
#
# Grocer::MobileDeviceManagementNotification.new(device_token: '...', push_magic: '...')
class MobileDeviceManagementNotification < Notification
attr_accessor :push_magic
private
def payload_hash
{ mdm: push_magic }
end
def validate_payload
fail NoPayloadError unless push_magic
fail InvalidFormatError if alert || badge || custom
fail PayloadTooLargeError if payload_too_large?
end
end
end
| require 'grocer/notification'
module Grocer
# Public: A specialized form of a Grocer::Notification which only requires a
# `push_magic` and `device_token` to be present in the payload.
#
# Examples
#
- # Grocer::PassbookNotification.new(device_token: '...', push_magic: '...')
? ^ ^^^^^^
+ # Grocer::MobileDeviceManagementNotification.new(device_token: '...', push_magic: '...')
? ^^^^^^^^^^^^^ ^^^^^^^^
class MobileDeviceManagementNotification < Notification
attr_accessor :push_magic
private
def payload_hash
{ mdm: push_magic }
end
def validate_payload
fail NoPayloadError unless push_magic
fail InvalidFormatError if alert || badge || custom
fail PayloadTooLargeError if payload_too_large?
end
end
end | 2 | 0.08 | 1 | 1 |
f218412d7b4333941afbb3e936ab87c3a325ceb5 | dart/pubspec.yaml | dart/pubspec.yaml | name: gilded_rose
version: 0.0.1
description: A simple console application.
dev_dependencies:
test: '>=0.12.11 <0.13.0'
| name: gilded_rose
version: 0.0.1
description: A simple console application.
environment:
sdk: '>=2.10.0 <3.0.0'
dev_dependencies:
test: ^1.16.8
| Add sdk constraint and update test deps | Add sdk constraint and update test deps | YAML | mit | emilybache/GildedRose-Refactoring-Kata,emilybache/GildedRose-Refactoring-Kata,emilybache/GildedRose-Refactoring-Kata,emilybache/GildedRose-Refactoring-Kata,emilybache/GildedRose-Refactoring-Kata,emilybache/GildedRose-Refactoring-Kata,emilybache/GildedRose-Refactoring-Kata,emilybache/GildedRose-Refactoring-Kata,emilybache/GildedRose-Refactoring-Kata,emilybache/GildedRose-Refactoring-Kata,emilybache/GildedRose-Refactoring-Kata,emilybache/GildedRose-Refactoring-Kata,emilybache/GildedRose-Refactoring-Kata,emilybache/GildedRose-Refactoring-Kata,emilybache/GildedRose-Refactoring-Kata,emilybache/GildedRose-Refactoring-Kata,emilybache/GildedRose-Refactoring-Kata,emilybache/GildedRose-Refactoring-Kata | yaml | ## Code Before:
name: gilded_rose
version: 0.0.1
description: A simple console application.
dev_dependencies:
test: '>=0.12.11 <0.13.0'
## Instruction:
Add sdk constraint and update test deps
## Code After:
name: gilded_rose
version: 0.0.1
description: A simple console application.
environment:
sdk: '>=2.10.0 <3.0.0'
dev_dependencies:
test: ^1.16.8
| name: gilded_rose
version: 0.0.1
description: A simple console application.
+ environment:
+ sdk: '>=2.10.0 <3.0.0'
+
dev_dependencies:
- test: '>=0.12.11 <0.13.0'
+ test: ^1.16.8 | 5 | 0.833333 | 4 | 1 |
f4958121562b28e0982e4779ddbb4664a75f76ae | build.sh | build.sh | mkdir ./build
DATE=`date "+%Y-%m-%d-%H-%M"`
dot -Tpng pushpull.dot > build/pushpull.png
pandoc -s event-data-manual.md --toc -o build/event-data-manual.$DATE.pdf
pandoc -s event-data-manual.md --toc -o build/event-data-manual.$DATE.html | mkdir ./build
DATE=`date "+%Y-%m-%d-%H-%M"`
dot -Tpng pushpull.dot > build/pushpull.png
rm build/event-data-manual.pdf
pandoc -s event-data-manual.md --toc -o build/event-data-manual.pdf
pandoc -s event-data-manual.md --toc -o build/event-data-manual.html
cp build/event-data-manual.pdf build/event-data-manual.$DATE.pdf | Build script creates dated copy plus current. | Build script creates dated copy plus current.
| Shell | mit | CrossRef/event-data-user-guide,CrossRef/event-data-user-guide,CrossRef/event-data-user-guide | shell | ## Code Before:
mkdir ./build
DATE=`date "+%Y-%m-%d-%H-%M"`
dot -Tpng pushpull.dot > build/pushpull.png
pandoc -s event-data-manual.md --toc -o build/event-data-manual.$DATE.pdf
pandoc -s event-data-manual.md --toc -o build/event-data-manual.$DATE.html
## Instruction:
Build script creates dated copy plus current.
## Code After:
mkdir ./build
DATE=`date "+%Y-%m-%d-%H-%M"`
dot -Tpng pushpull.dot > build/pushpull.png
rm build/event-data-manual.pdf
pandoc -s event-data-manual.md --toc -o build/event-data-manual.pdf
pandoc -s event-data-manual.md --toc -o build/event-data-manual.html
cp build/event-data-manual.pdf build/event-data-manual.$DATE.pdf | mkdir ./build
DATE=`date "+%Y-%m-%d-%H-%M"`
dot -Tpng pushpull.dot > build/pushpull.png
+ rm build/event-data-manual.pdf
+
- pandoc -s event-data-manual.md --toc -o build/event-data-manual.$DATE.pdf
? ------
+ pandoc -s event-data-manual.md --toc -o build/event-data-manual.pdf
- pandoc -s event-data-manual.md --toc -o build/event-data-manual.$DATE.html
? ------
+ pandoc -s event-data-manual.md --toc -o build/event-data-manual.html
+
+ cp build/event-data-manual.pdf build/event-data-manual.$DATE.pdf | 8 | 1 | 6 | 2 |
59db6bb2b942ecefb2cdebc87aaa8fbb140e1531 | Cargo.toml | Cargo.toml | [project]
name = "civet"
version = "0.1.0"
authors = ["wycats"]
build = "make -f cargo.mk"
[dependencies.route-recognizer]
git = "https://github.com/wycats/route-recognizer.rs"
[dependencies.conduit]
git = "https://github.com/wycats/conduit"
#[[bin]]
#name = "channel_response"
#path = "examples/channel_response.rs"
[[bin]]
name = "simple"
path = "examples/simple.rs"
[[bin]]
name = "routed"
path = "examples/routed.rs"
[[lib]]
name = "civet"
path = "src/lib.rs"
| [project]
name = "civet"
version = "0.1.0"
authors = ["wycats"]
build = "make -f cargo.mk"
[dependencies.route-recognizer]
git = "https://github.com/conduit-rust/route-recognizer.rs"
[dependencies.conduit]
git = "https://github.com/conduit-rust/conduit"
#[[bin]]
#name = "channel_response"
#path = "examples/channel_response.rs"
[[bin]]
name = "simple"
path = "examples/simple.rs"
[[bin]]
name = "routed"
path = "examples/routed.rs"
[[lib]]
name = "civet"
path = "src/lib.rs"
| Change the location of conduit packages | Change the location of conduit packages
| TOML | mit | wycats/rust-civet | toml | ## Code Before:
[project]
name = "civet"
version = "0.1.0"
authors = ["wycats"]
build = "make -f cargo.mk"
[dependencies.route-recognizer]
git = "https://github.com/wycats/route-recognizer.rs"
[dependencies.conduit]
git = "https://github.com/wycats/conduit"
#[[bin]]
#name = "channel_response"
#path = "examples/channel_response.rs"
[[bin]]
name = "simple"
path = "examples/simple.rs"
[[bin]]
name = "routed"
path = "examples/routed.rs"
[[lib]]
name = "civet"
path = "src/lib.rs"
## Instruction:
Change the location of conduit packages
## Code After:
[project]
name = "civet"
version = "0.1.0"
authors = ["wycats"]
build = "make -f cargo.mk"
[dependencies.route-recognizer]
git = "https://github.com/conduit-rust/route-recognizer.rs"
[dependencies.conduit]
git = "https://github.com/conduit-rust/conduit"
#[[bin]]
#name = "channel_response"
#path = "examples/channel_response.rs"
[[bin]]
name = "simple"
path = "examples/simple.rs"
[[bin]]
name = "routed"
path = "examples/routed.rs"
[[lib]]
name = "civet"
path = "src/lib.rs"
| [project]
name = "civet"
version = "0.1.0"
authors = ["wycats"]
build = "make -f cargo.mk"
[dependencies.route-recognizer]
- git = "https://github.com/wycats/route-recognizer.rs"
? -- ^
+ git = "https://github.com/conduit-rust/route-recognizer.rs"
? ^^^^^ +++ +
[dependencies.conduit]
- git = "https://github.com/wycats/conduit"
? -- ^
+ git = "https://github.com/conduit-rust/conduit"
? ^^^^^ +++ +
#[[bin]]
#name = "channel_response"
#path = "examples/channel_response.rs"
[[bin]]
name = "simple"
path = "examples/simple.rs"
[[bin]]
name = "routed"
path = "examples/routed.rs"
[[lib]]
name = "civet"
path = "src/lib.rs" | 4 | 0.117647 | 2 | 2 |
e71b34dbd6ff3fbdf2eb7485762136eda2926a98 | lib/phrender.rb | lib/phrender.rb | require "phrender/version"
require "phrender/logger"
require "phrender/phantom_js_engine"
require "phrender/phantom_js_session"
require "phrender/rack_base"
require "phrender/rack_middleware"
require "phrender/rack_static"
class Phrender
end
| require "phrender/version"
require "phrender/logger"
require "phrender/phantom_js_engine"
require "phrender/phantom_js_session"
require "phrender/rack_middleware"
require "phrender/rack_static"
class Phrender
end
| Remove reference to deleted file. | Remove reference to deleted file.
| Ruby | mit | scoremedia/phrender,scoremedia/phrender | ruby | ## Code Before:
require "phrender/version"
require "phrender/logger"
require "phrender/phantom_js_engine"
require "phrender/phantom_js_session"
require "phrender/rack_base"
require "phrender/rack_middleware"
require "phrender/rack_static"
class Phrender
end
## Instruction:
Remove reference to deleted file.
## Code After:
require "phrender/version"
require "phrender/logger"
require "phrender/phantom_js_engine"
require "phrender/phantom_js_session"
require "phrender/rack_middleware"
require "phrender/rack_static"
class Phrender
end
| require "phrender/version"
require "phrender/logger"
require "phrender/phantom_js_engine"
require "phrender/phantom_js_session"
- require "phrender/rack_base"
require "phrender/rack_middleware"
require "phrender/rack_static"
class Phrender
end | 1 | 0.1 | 0 | 1 |
be8ee822d2aa0669c5702c185edae60af82251a9 | src/org/bouncycastle/crypto/util/Pack.java | src/org/bouncycastle/crypto/util/Pack.java | package org.bouncycastle.crypto.util;
public abstract class Pack
{
public static int bigEndianToInt(byte[] bs, int off)
{
int n = bs[off++] << 24;
n |= (bs[off++] & 0xff) << 16;
n |= (bs[off++] & 0xff) << 8;
n |= (bs[off++] & 0xff);
return n;
}
public static void intToBigEndian(int n, byte[] bs, int off)
{
bs[off++] = (byte)(n >>> 24);
bs[off++] = (byte)(n >>> 16);
bs[off++] = (byte)(n >>> 8);
bs[off ] = (byte)(n );
}
}
| package org.bouncycastle.crypto.util;
public abstract class Pack
{
public static int bigEndianToInt(byte[] bs, int off)
{
int n = bs[ off] << 24;
n |= (bs[++off] & 0xff) << 16;
n |= (bs[++off] & 0xff) << 8;
n |= (bs[++off] & 0xff);
return n;
}
public static void intToBigEndian(int n, byte[] bs, int off)
{
bs[ off] = (byte)(n >>> 24);
bs[++off] = (byte)(n >>> 16);
bs[++off] = (byte)(n >>> 8);
bs[++off] = (byte)(n );
}
public static long bigEndianToLong(byte[] bs, int off)
{
int hi = bigEndianToInt(bs, off);
int lo = bigEndianToInt(bs, off + 4);
return ((long)(hi & 0xffffffffL) << 32) | (long)(lo & 0xffffffffL);
}
public static void longToBigEndian(long n, byte[] bs, int off)
{
intToBigEndian((int)(n >>> 32), bs, off);
intToBigEndian((int)(n & 0xffffffffL), bs, off + 4);
}
}
| Improve existing methods, add new ones for packing longs | Improve existing methods, add new ones for packing longs
| Java | mit | sake/bouncycastle-java | java | ## Code Before:
package org.bouncycastle.crypto.util;
public abstract class Pack
{
public static int bigEndianToInt(byte[] bs, int off)
{
int n = bs[off++] << 24;
n |= (bs[off++] & 0xff) << 16;
n |= (bs[off++] & 0xff) << 8;
n |= (bs[off++] & 0xff);
return n;
}
public static void intToBigEndian(int n, byte[] bs, int off)
{
bs[off++] = (byte)(n >>> 24);
bs[off++] = (byte)(n >>> 16);
bs[off++] = (byte)(n >>> 8);
bs[off ] = (byte)(n );
}
}
## Instruction:
Improve existing methods, add new ones for packing longs
## Code After:
package org.bouncycastle.crypto.util;
public abstract class Pack
{
public static int bigEndianToInt(byte[] bs, int off)
{
int n = bs[ off] << 24;
n |= (bs[++off] & 0xff) << 16;
n |= (bs[++off] & 0xff) << 8;
n |= (bs[++off] & 0xff);
return n;
}
public static void intToBigEndian(int n, byte[] bs, int off)
{
bs[ off] = (byte)(n >>> 24);
bs[++off] = (byte)(n >>> 16);
bs[++off] = (byte)(n >>> 8);
bs[++off] = (byte)(n );
}
public static long bigEndianToLong(byte[] bs, int off)
{
int hi = bigEndianToInt(bs, off);
int lo = bigEndianToInt(bs, off + 4);
return ((long)(hi & 0xffffffffL) << 32) | (long)(lo & 0xffffffffL);
}
public static void longToBigEndian(long n, byte[] bs, int off)
{
intToBigEndian((int)(n >>> 32), bs, off);
intToBigEndian((int)(n & 0xffffffffL), bs, off + 4);
}
}
| package org.bouncycastle.crypto.util;
public abstract class Pack
{
public static int bigEndianToInt(byte[] bs, int off)
{
- int n = bs[off++] << 24;
? --
+ int n = bs[ off] << 24;
? ++
- n |= (bs[off++] & 0xff) << 16;
? --
+ n |= (bs[++off] & 0xff) << 16;
? ++
- n |= (bs[off++] & 0xff) << 8;
? --
+ n |= (bs[++off] & 0xff) << 8;
? ++
- n |= (bs[off++] & 0xff);
? --
+ n |= (bs[++off] & 0xff);
? ++
return n;
}
public static void intToBigEndian(int n, byte[] bs, int off)
{
- bs[off++] = (byte)(n >>> 24);
? --
+ bs[ off] = (byte)(n >>> 24);
? ++
- bs[off++] = (byte)(n >>> 16);
? --
+ bs[++off] = (byte)(n >>> 16);
? ++
- bs[off++] = (byte)(n >>> 8);
? --
+ bs[++off] = (byte)(n >>> 8);
? ++
- bs[off ] = (byte)(n );
? --
+ bs[++off] = (byte)(n );
? ++
+ }
+
+ public static long bigEndianToLong(byte[] bs, int off)
+ {
+ int hi = bigEndianToInt(bs, off);
+ int lo = bigEndianToInt(bs, off + 4);
+ return ((long)(hi & 0xffffffffL) << 32) | (long)(lo & 0xffffffffL);
+ }
+
+ public static void longToBigEndian(long n, byte[] bs, int off)
+ {
+ intToBigEndian((int)(n >>> 32), bs, off);
+ intToBigEndian((int)(n & 0xffffffffL), bs, off + 4);
}
} | 29 | 1.380952 | 21 | 8 |
a5ab67228f07f6fa1a5db7da07601643b87f23ff | app/views/shared/milestones/_deprecation_message.html.haml | app/views/shared/milestones/_deprecation_message.html.haml | .milestone-deprecation-message.prepend-top-default.prepend-left-default
.illustration.inline= image_tag 'illustrations/milestone_removing-page.svg', class: 'append-right-default'
.inline.vertical-align-middle
%strong= _('This page will be removed in a future release.')
%p.append-bottom-default.prepend-top-5
= _('Use group milestones to manage issues from multiple projects in the same milestone.')
%br
= button_tag _('Promote these project milestones into a group milestone.'), class: 'btn-link popover-link'
%div= link_to _('Learn more'), help_page_url('user/project/milestones/index', anchor: 'promoting-project-milestones-to-group-milestones'), class: 'btn btn-default'
%script.milestone-deprecation-message-template{ type: 'text/template' }
%ol.instructions-list.append-bottom-0
%li= _('Click any <strong>project name</strong> in the project list below to navigate to the project milestone.')
%li= _('Click the <strong>Promote</strong> button in the top right corner to promote it to a group milestone.')
.footer= link_to _('Learn more'), help_page_url('user/project/milestones/index', anchor: 'promoting-project-milestones-to-group-milestones'), class: 'btn-link' | .milestone-deprecation-message.prepend-top-default.prepend-left-default
.illustration.inline= image_tag 'illustrations/milestone_removing-page.svg', class: 'append-right-default'
.inline.vertical-align-middle
%strong= _('This page will be removed in a future release.')
%p.append-bottom-default.prepend-top-5
= _('Use group milestones to manage issues from multiple projects in the same milestone.')
%br
= button_tag _('Promote these project milestones into a group milestone.'), class: 'btn-link popover-link'
%div= link_to _('Learn more'), help_page_url('user/project/milestones/index', anchor: 'promoting-project-milestones-to-group-milestones'), class: 'btn btn-default', target: '_blank'
%script.milestone-deprecation-message-template{ type: 'text/template' }
%ol.instructions-list.append-bottom-0
%li= _('Click any <strong>project name</strong> in the project list below to navigate to the project milestone.').html_safe
%li= _('Click the <strong>Promote</strong> button in the top right corner to promote it to a group milestone.').html_safe
.footer= link_to _('Learn more'), help_page_url('user/project/milestones/index', anchor: 'promoting-project-milestones-to-group-milestones'), class: 'btn-link', target: '_blank' | Fix translation strings and add _blank as link targets | Fix translation strings and add _blank as link targets
| Haml | mit | jirutka/gitlabhq,axilleas/gitlabhq,stoplightio/gitlabhq,dreampet/gitlab,dreampet/gitlab,stoplightio/gitlabhq,jirutka/gitlabhq,iiet/iiet-git,mmkassem/gitlabhq,iiet/iiet-git,mmkassem/gitlabhq,axilleas/gitlabhq,dreampet/gitlab,jirutka/gitlabhq,stoplightio/gitlabhq,iiet/iiet-git,dreampet/gitlab,axilleas/gitlabhq,axilleas/gitlabhq,iiet/iiet-git,jirutka/gitlabhq,mmkassem/gitlabhq,mmkassem/gitlabhq,stoplightio/gitlabhq | haml | ## Code Before:
.milestone-deprecation-message.prepend-top-default.prepend-left-default
.illustration.inline= image_tag 'illustrations/milestone_removing-page.svg', class: 'append-right-default'
.inline.vertical-align-middle
%strong= _('This page will be removed in a future release.')
%p.append-bottom-default.prepend-top-5
= _('Use group milestones to manage issues from multiple projects in the same milestone.')
%br
= button_tag _('Promote these project milestones into a group milestone.'), class: 'btn-link popover-link'
%div= link_to _('Learn more'), help_page_url('user/project/milestones/index', anchor: 'promoting-project-milestones-to-group-milestones'), class: 'btn btn-default'
%script.milestone-deprecation-message-template{ type: 'text/template' }
%ol.instructions-list.append-bottom-0
%li= _('Click any <strong>project name</strong> in the project list below to navigate to the project milestone.')
%li= _('Click the <strong>Promote</strong> button in the top right corner to promote it to a group milestone.')
.footer= link_to _('Learn more'), help_page_url('user/project/milestones/index', anchor: 'promoting-project-milestones-to-group-milestones'), class: 'btn-link'
## Instruction:
Fix translation strings and add _blank as link targets
## Code After:
.milestone-deprecation-message.prepend-top-default.prepend-left-default
.illustration.inline= image_tag 'illustrations/milestone_removing-page.svg', class: 'append-right-default'
.inline.vertical-align-middle
%strong= _('This page will be removed in a future release.')
%p.append-bottom-default.prepend-top-5
= _('Use group milestones to manage issues from multiple projects in the same milestone.')
%br
= button_tag _('Promote these project milestones into a group milestone.'), class: 'btn-link popover-link'
%div= link_to _('Learn more'), help_page_url('user/project/milestones/index', anchor: 'promoting-project-milestones-to-group-milestones'), class: 'btn btn-default', target: '_blank'
%script.milestone-deprecation-message-template{ type: 'text/template' }
%ol.instructions-list.append-bottom-0
%li= _('Click any <strong>project name</strong> in the project list below to navigate to the project milestone.').html_safe
%li= _('Click the <strong>Promote</strong> button in the top right corner to promote it to a group milestone.').html_safe
.footer= link_to _('Learn more'), help_page_url('user/project/milestones/index', anchor: 'promoting-project-milestones-to-group-milestones'), class: 'btn-link', target: '_blank' | .milestone-deprecation-message.prepend-top-default.prepend-left-default
.illustration.inline= image_tag 'illustrations/milestone_removing-page.svg', class: 'append-right-default'
.inline.vertical-align-middle
%strong= _('This page will be removed in a future release.')
%p.append-bottom-default.prepend-top-5
= _('Use group milestones to manage issues from multiple projects in the same milestone.')
%br
= button_tag _('Promote these project milestones into a group milestone.'), class: 'btn-link popover-link'
- %div= link_to _('Learn more'), help_page_url('user/project/milestones/index', anchor: 'promoting-project-milestones-to-group-milestones'), class: 'btn btn-default'
+ %div= link_to _('Learn more'), help_page_url('user/project/milestones/index', anchor: 'promoting-project-milestones-to-group-milestones'), class: 'btn btn-default', target: '_blank'
? ++++++++++++++++++
%script.milestone-deprecation-message-template{ type: 'text/template' }
%ol.instructions-list.append-bottom-0
- %li= _('Click any <strong>project name</strong> in the project list below to navigate to the project milestone.')
+ %li= _('Click any <strong>project name</strong> in the project list below to navigate to the project milestone.').html_safe
? ++++++++++
- %li= _('Click the <strong>Promote</strong> button in the top right corner to promote it to a group milestone.')
+ %li= _('Click the <strong>Promote</strong> button in the top right corner to promote it to a group milestone.').html_safe
? ++++++++++
- .footer= link_to _('Learn more'), help_page_url('user/project/milestones/index', anchor: 'promoting-project-milestones-to-group-milestones'), class: 'btn-link'
+ .footer= link_to _('Learn more'), help_page_url('user/project/milestones/index', anchor: 'promoting-project-milestones-to-group-milestones'), class: 'btn-link', target: '_blank'
? ++++++++++++++++++
| 8 | 0.533333 | 4 | 4 |
d8d8c79aac63411a7c4870db10ed7fc4f2fb270a | README.md | README.md | OpenTable JAX-RS Component
==========================
[](https://travis-ci.org/opentable/otj-jaxrs)
Component Charter
-----------------
* Provides bindings from a JAX-RS Client provider into the Spring, configuration, and `otj-server` ecosystem.
- Can swap out Jersey for RESTEasy
- Register Features with Spring DI environment
* Brings in `otj-jackson` support for directly reading and writing JSON.
Component Level
---------------
----
Copyright (C) 2014 OpenTable, Inc.
| OpenTable JAX-RS Component
==========================
[](https://travis-ci.org/opentable/otj-jaxrs)
Component Charter
-----------------
* Provides bindings from a JAX-RS Client provider into the Spring, configuration, and `otj-server` ecosystem.
- Can swap out Jersey for RESTEasy
- Register Features with Spring DI environment
* Brings in `otj-jackson` support for directly reading and writing JSON.
Component Level
---------------
Configuration
--------------
The JAX-RS client configuration is managed through your application properties.
Options are configured using the provided client name and the corresponding jaxrs configuration:
EX: client name: "availability"
"jaxrs.client.availability.connectionPool=50"
For configuration options that take time, use the ISO 8601 Durations format (https://en.wikipedia.org/wiki/ISO_8601).
Example: Configure the connection timeout to 5s
"jaxrs.client.availability.connectTimeout=PT5s"
For values smaller than seconds you may use decimals per the ISO 8601 format:
"The smallest value used may also have a decimal fraction, as in "P0.5Y" to indicate half a year. This decimal fraction may be specified with either a comma or a full stop, as in "P0,5Y" or "P0.5Y"."
To configure a connection timeout of 150ms:
"jaxrs.client.availability.connectTimeout=PT0.150s"
For a list of configurable options see the client/src/main/java/com/opentable/jaxrs/JaxRsClientConfig.java
----
Copyright (C) 2014 OpenTable, Inc.
| Document how to configure the jaxrs client configuration | Document how to configure the jaxrs client configuration
| Markdown | apache-2.0 | sannessa/otj-jaxrs | markdown | ## Code Before:
OpenTable JAX-RS Component
==========================
[](https://travis-ci.org/opentable/otj-jaxrs)
Component Charter
-----------------
* Provides bindings from a JAX-RS Client provider into the Spring, configuration, and `otj-server` ecosystem.
- Can swap out Jersey for RESTEasy
- Register Features with Spring DI environment
* Brings in `otj-jackson` support for directly reading and writing JSON.
Component Level
---------------
----
Copyright (C) 2014 OpenTable, Inc.
## Instruction:
Document how to configure the jaxrs client configuration
## Code After:
OpenTable JAX-RS Component
==========================
[](https://travis-ci.org/opentable/otj-jaxrs)
Component Charter
-----------------
* Provides bindings from a JAX-RS Client provider into the Spring, configuration, and `otj-server` ecosystem.
- Can swap out Jersey for RESTEasy
- Register Features with Spring DI environment
* Brings in `otj-jackson` support for directly reading and writing JSON.
Component Level
---------------
Configuration
--------------
The JAX-RS client configuration is managed through your application properties.
Options are configured using the provided client name and the corresponding jaxrs configuration:
EX: client name: "availability"
"jaxrs.client.availability.connectionPool=50"
For configuration options that take time, use the ISO 8601 Durations format (https://en.wikipedia.org/wiki/ISO_8601).
Example: Configure the connection timeout to 5s
"jaxrs.client.availability.connectTimeout=PT5s"
For values smaller than seconds you may use decimals per the ISO 8601 format:
"The smallest value used may also have a decimal fraction, as in "P0.5Y" to indicate half a year. This decimal fraction may be specified with either a comma or a full stop, as in "P0,5Y" or "P0.5Y"."
To configure a connection timeout of 150ms:
"jaxrs.client.availability.connectTimeout=PT0.150s"
For a list of configurable options see the client/src/main/java/com/opentable/jaxrs/JaxRsClientConfig.java
----
Copyright (C) 2014 OpenTable, Inc.
| OpenTable JAX-RS Component
==========================
[](https://travis-ci.org/opentable/otj-jaxrs)
Component Charter
-----------------
* Provides bindings from a JAX-RS Client provider into the Spring, configuration, and `otj-server` ecosystem.
- Can swap out Jersey for RESTEasy
- Register Features with Spring DI environment
* Brings in `otj-jackson` support for directly reading and writing JSON.
Component Level
---------------
+ Configuration
+ --------------
+ The JAX-RS client configuration is managed through your application properties.
+ Options are configured using the provided client name and the corresponding jaxrs configuration:
+ EX: client name: "availability"
+ "jaxrs.client.availability.connectionPool=50"
+
+ For configuration options that take time, use the ISO 8601 Durations format (https://en.wikipedia.org/wiki/ISO_8601).
+
+ Example: Configure the connection timeout to 5s
+ "jaxrs.client.availability.connectTimeout=PT5s"
+
+ For values smaller than seconds you may use decimals per the ISO 8601 format:
+ "The smallest value used may also have a decimal fraction, as in "P0.5Y" to indicate half a year. This decimal fraction may be specified with either a comma or a full stop, as in "P0,5Y" or "P0.5Y"."
+
+ To configure a connection timeout of 150ms:
+ "jaxrs.client.availability.connectTimeout=PT0.150s"
+
+ For a list of configurable options see the client/src/main/java/com/opentable/jaxrs/JaxRsClientConfig.java
----
Copyright (C) 2014 OpenTable, Inc. | 19 | 1 | 19 | 0 |
9468c392a776d8748367b74dcf4be01053aecd16 | aliases/etc.sh | aliases/etc.sh | alias fig='find . | grep'
alias ll='ls -alh --group-directories-first'
alias rmf='sudo rm -rf'
alias dfh='df -h'
alias duh='du -sch'
alias psg='ps aux | grep'
alias gi='grep -i'
alias gri='grep -rinI'
alias frh='free -h'
alias ssh='ssh -X'
alias wchere='cat $(find .) 2>/dev/null | wc'
alias eg='env | grep -i'
alias cdd='cd ..'
alias cddd='cd ../..'
alias cdddd='cd ../../..'
alias cddddd='cd ../../../..'
function pingbg() {
ping -i 60 $1 >/dev/null 2>&1 &
}
alias fs='sudo chown stack:stack `readlink /proc/self/fd/0`'
function aw() {
awk "{print \$${1:-1}}" $2;
}
alias venv='source ~/src/venvs/main/bin/activate'
alias quit='exit'
| alias fig='find . | grep'
alias ll='ls -alh --group-directories-first'
alias rmf='sudo rm -rf'
alias dfh='df -h'
alias duh='du -sch'
alias psg='ps aux | grep'
alias gi='grep -i'
alias gri='grep -rinI'
alias frh='free -h'
alias ssh='ssh -X'
alias wchere='cat $(find .) 2>/dev/null | wc'
alias eg='env | grep -i'
alias cdd='cd ..'
alias cddd='cd ../..'
alias cdddd='cd ../../..'
alias cddddd='cd ../../../..'
alias cds='cd ~/src'
alias cdn='cd ~/notes'
function pingbg() {
ping -i 60 $1 >/dev/null 2>&1 &
}
alias fs='sudo chown stack:stack `readlink /proc/self/fd/0`'
function aw() {
awk "{print \$${1:-1}}" $2;
}
alias venv='source ~/src/venvs/main/bin/activate'
alias quit='exit'
| Add cds and cdn for notes and src directory | Add cds and cdn for notes and src directory
| Shell | mit | rushiagr/myutils,rushiagr/myutils,rushiagr/myutils | shell | ## Code Before:
alias fig='find . | grep'
alias ll='ls -alh --group-directories-first'
alias rmf='sudo rm -rf'
alias dfh='df -h'
alias duh='du -sch'
alias psg='ps aux | grep'
alias gi='grep -i'
alias gri='grep -rinI'
alias frh='free -h'
alias ssh='ssh -X'
alias wchere='cat $(find .) 2>/dev/null | wc'
alias eg='env | grep -i'
alias cdd='cd ..'
alias cddd='cd ../..'
alias cdddd='cd ../../..'
alias cddddd='cd ../../../..'
function pingbg() {
ping -i 60 $1 >/dev/null 2>&1 &
}
alias fs='sudo chown stack:stack `readlink /proc/self/fd/0`'
function aw() {
awk "{print \$${1:-1}}" $2;
}
alias venv='source ~/src/venvs/main/bin/activate'
alias quit='exit'
## Instruction:
Add cds and cdn for notes and src directory
## Code After:
alias fig='find . | grep'
alias ll='ls -alh --group-directories-first'
alias rmf='sudo rm -rf'
alias dfh='df -h'
alias duh='du -sch'
alias psg='ps aux | grep'
alias gi='grep -i'
alias gri='grep -rinI'
alias frh='free -h'
alias ssh='ssh -X'
alias wchere='cat $(find .) 2>/dev/null | wc'
alias eg='env | grep -i'
alias cdd='cd ..'
alias cddd='cd ../..'
alias cdddd='cd ../../..'
alias cddddd='cd ../../../..'
alias cds='cd ~/src'
alias cdn='cd ~/notes'
function pingbg() {
ping -i 60 $1 >/dev/null 2>&1 &
}
alias fs='sudo chown stack:stack `readlink /proc/self/fd/0`'
function aw() {
awk "{print \$${1:-1}}" $2;
}
alias venv='source ~/src/venvs/main/bin/activate'
alias quit='exit'
| alias fig='find . | grep'
alias ll='ls -alh --group-directories-first'
alias rmf='sudo rm -rf'
alias dfh='df -h'
alias duh='du -sch'
alias psg='ps aux | grep'
alias gi='grep -i'
alias gri='grep -rinI'
alias frh='free -h'
alias ssh='ssh -X'
alias wchere='cat $(find .) 2>/dev/null | wc'
alias eg='env | grep -i'
alias cdd='cd ..'
alias cddd='cd ../..'
alias cdddd='cd ../../..'
alias cddddd='cd ../../../..'
+ alias cds='cd ~/src'
+ alias cdn='cd ~/notes'
function pingbg() {
ping -i 60 $1 >/dev/null 2>&1 &
}
alias fs='sudo chown stack:stack `readlink /proc/self/fd/0`'
function aw() {
awk "{print \$${1:-1}}" $2;
}
alias venv='source ~/src/venvs/main/bin/activate'
alias quit='exit' | 2 | 0.074074 | 2 | 0 |
e0c6a90948e196f52f04819f0baf0b97b92f8457 | flex-box/css/flex-box.css | flex-box/css/flex-box.css | /* Flex Box Styles */
.overlay {
/* Position absolute and box models do not work under gecko */
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.overlay-box {
display: -webkit-box;
display: -moz-box;
display: box;
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
box-orient: vertical;
width: 100%;
height: 100%;
}
.overlay-header {
/* These values are defaults per the specification. Including for demonstrational purposes */
-webkit-box-flex: 0;
-moz-box-flex: 0;
box-flex: 0;
}
.overlay-content {
-webkit-box-flex: 1;
-moz-box-flex: 1;
box-flex: 1;
overflow: auto;
/* This is a hack to force gecko to implement the desired behavior */
min-height: 1px;
}
/* General UI Styling */
.frame {
position: relative;
width: 500px;
margin-left: 262px;
overflow: hidden;
}
.overlay {
background-image: url(../images/translucent-background.png);
}
.overlay-header {
background-color: green;
}
.content-image {
/* This is specific to the image in use to maintain the proper aspect ratio */
width: 100%;
height: auto;
}
| /* Flex Box Styles */
.overlay {
/* Position absolute and box models do not work under gecko */
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.overlay-box {
display: -webkit-box;
display: -moz-box;
display: box;
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
box-orient: vertical;
width: 100%;
height: 100%;
}
.overlay-header {
/* These values are defaults per the specification. Including for demonstrational purposes */
-webkit-box-flex: 0;
-moz-box-flex: 0;
box-flex: 0;
}
.overlay-content {
-webkit-box-flex: 1;
-moz-box-flex: 1;
box-flex: 1;
overflow: auto;
/* This is a hack to force gecko to implement the desired behavior */
min-height: 1px;
}
/* General UI Styling */
.frame {
position: relative;
width: 500px;
margin: 25px 0px 25px 262px;
overflow: hidden;
}
.overlay {
background-image: url(../images/translucent-background.png);
}
.overlay-header {
background-color: #83ADC8;
color: black;
}
.content-image {
/* This is specific to the image in use to maintain the proper aspect ratio */
width: 100%;
height: auto;
}
| Make the styles a little easier on the eyes | Make the styles a little easier on the eyes
| CSS | bsd-3-clause | kpdecker/demo | css | ## Code Before:
/* Flex Box Styles */
.overlay {
/* Position absolute and box models do not work under gecko */
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.overlay-box {
display: -webkit-box;
display: -moz-box;
display: box;
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
box-orient: vertical;
width: 100%;
height: 100%;
}
.overlay-header {
/* These values are defaults per the specification. Including for demonstrational purposes */
-webkit-box-flex: 0;
-moz-box-flex: 0;
box-flex: 0;
}
.overlay-content {
-webkit-box-flex: 1;
-moz-box-flex: 1;
box-flex: 1;
overflow: auto;
/* This is a hack to force gecko to implement the desired behavior */
min-height: 1px;
}
/* General UI Styling */
.frame {
position: relative;
width: 500px;
margin-left: 262px;
overflow: hidden;
}
.overlay {
background-image: url(../images/translucent-background.png);
}
.overlay-header {
background-color: green;
}
.content-image {
/* This is specific to the image in use to maintain the proper aspect ratio */
width: 100%;
height: auto;
}
## Instruction:
Make the styles a little easier on the eyes
## Code After:
/* Flex Box Styles */
.overlay {
/* Position absolute and box models do not work under gecko */
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.overlay-box {
display: -webkit-box;
display: -moz-box;
display: box;
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
box-orient: vertical;
width: 100%;
height: 100%;
}
.overlay-header {
/* These values are defaults per the specification. Including for demonstrational purposes */
-webkit-box-flex: 0;
-moz-box-flex: 0;
box-flex: 0;
}
.overlay-content {
-webkit-box-flex: 1;
-moz-box-flex: 1;
box-flex: 1;
overflow: auto;
/* This is a hack to force gecko to implement the desired behavior */
min-height: 1px;
}
/* General UI Styling */
.frame {
position: relative;
width: 500px;
margin: 25px 0px 25px 262px;
overflow: hidden;
}
.overlay {
background-image: url(../images/translucent-background.png);
}
.overlay-header {
background-color: #83ADC8;
color: black;
}
.content-image {
/* This is specific to the image in use to maintain the proper aspect ratio */
width: 100%;
height: auto;
}
| /* Flex Box Styles */
.overlay {
/* Position absolute and box models do not work under gecko */
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.overlay-box {
display: -webkit-box;
display: -moz-box;
display: box;
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
box-orient: vertical;
width: 100%;
height: 100%;
}
.overlay-header {
/* These values are defaults per the specification. Including for demonstrational purposes */
-webkit-box-flex: 0;
-moz-box-flex: 0;
box-flex: 0;
}
.overlay-content {
-webkit-box-flex: 1;
-moz-box-flex: 1;
box-flex: 1;
overflow: auto;
/* This is a hack to force gecko to implement the desired behavior */
min-height: 1px;
}
/* General UI Styling */
.frame {
position: relative;
width: 500px;
- margin-left: 262px;
+ margin: 25px 0px 25px 262px;
overflow: hidden;
}
.overlay {
background-image: url(../images/translucent-background.png);
}
.overlay-header {
- background-color: green;
? ^^^^^
+ background-color: #83ADC8;
? ^^^^^^^
+ color: black;
}
.content-image {
/* This is specific to the image in use to maintain the proper aspect ratio */
width: 100%;
height: auto;
} | 5 | 0.092593 | 3 | 2 |
5f935bb952a616c3fe9ca24fa862621dfc1bda24 | guv/hubs/watchers.py | guv/hubs/watchers.py | from guv.hubs.abc import AbstractListener
class FdListener(AbstractListener):
"""Default implementation of :cls:`AbstractListener`
"""
pass
class PollFdListener(AbstractListener):
def __init__(self, evtype, fd, cb):
"""
:param cb: Callable
:param args: tuple of arguments to be passed to cb
"""
super().__init__(evtype, fd)
self.cb = cb
class UvFdListener(AbstractListener):
def __init__(self, evtype, fd, handle):
"""
:param handle: underlying pyuv Handle object
:type handle: pyuv.Handle
"""
super().__init__(evtype, fd)
self.handle = handle
| from guv.hubs.abc import AbstractListener
class PollFdListener(AbstractListener):
def __init__(self, evtype, fd, cb):
"""
:param cb: Callable
:param args: tuple of arguments to be passed to cb
"""
super().__init__(evtype, fd)
self.cb = cb
class UvFdListener(AbstractListener):
def __init__(self, evtype, fd, handle):
"""
:param handle: underlying pyuv Handle object
:type handle: pyuv.Handle
"""
super().__init__(evtype, fd)
self.handle = handle
| Remove unneeded default Listener implementation | Remove unneeded default Listener implementation
| Python | mit | veegee/guv,veegee/guv | python | ## Code Before:
from guv.hubs.abc import AbstractListener
class FdListener(AbstractListener):
"""Default implementation of :cls:`AbstractListener`
"""
pass
class PollFdListener(AbstractListener):
def __init__(self, evtype, fd, cb):
"""
:param cb: Callable
:param args: tuple of arguments to be passed to cb
"""
super().__init__(evtype, fd)
self.cb = cb
class UvFdListener(AbstractListener):
def __init__(self, evtype, fd, handle):
"""
:param handle: underlying pyuv Handle object
:type handle: pyuv.Handle
"""
super().__init__(evtype, fd)
self.handle = handle
## Instruction:
Remove unneeded default Listener implementation
## Code After:
from guv.hubs.abc import AbstractListener
class PollFdListener(AbstractListener):
def __init__(self, evtype, fd, cb):
"""
:param cb: Callable
:param args: tuple of arguments to be passed to cb
"""
super().__init__(evtype, fd)
self.cb = cb
class UvFdListener(AbstractListener):
def __init__(self, evtype, fd, handle):
"""
:param handle: underlying pyuv Handle object
:type handle: pyuv.Handle
"""
super().__init__(evtype, fd)
self.handle = handle
| from guv.hubs.abc import AbstractListener
-
-
- class FdListener(AbstractListener):
- """Default implementation of :cls:`AbstractListener`
- """
- pass
class PollFdListener(AbstractListener):
def __init__(self, evtype, fd, cb):
"""
:param cb: Callable
:param args: tuple of arguments to be passed to cb
"""
super().__init__(evtype, fd)
self.cb = cb
class UvFdListener(AbstractListener):
def __init__(self, evtype, fd, handle):
"""
:param handle: underlying pyuv Handle object
:type handle: pyuv.Handle
"""
super().__init__(evtype, fd)
self.handle = handle | 6 | 0.222222 | 0 | 6 |
1146db3fdf267e258d7b1d23301298cd4ddf7844 | app/workers/rollback_worker.rb | app/workers/rollback_worker.rb | class RollbackWorker
include Sidekiq::Worker
sidekiq_options queue: :rollbacks
def perform(date, redownload = false)
TariffSynchronizer.rollback(date, redownload)
end
end
| class RollbackWorker
include Sidekiq::Worker
sidekiq_options queue: :rollbacks
# Retry the job for 24 hours, after that the rollback has to be be recreated.
sidekiq_options retry: 24
# Retry the job every hour (the sync runs each hour)
sidekiq_retry_in do |count|
3600
end
def perform(date, redownload = false)
TariffSynchronizer.rollback(date, redownload)
end
end
| Change the sidekiq retry job to match the sync schedule. | Change the sidekiq retry job to match the sync schedule.
The sync is run each hour, so we should retry on the same schedule.
If it fails for a day then we should stop trying.
| Ruby | mit | leftees/trade-tariff-backend,bitzesty/trade-tariff-backend,bitzesty/trade-tariff-backend,alphagov/trade-tariff-backend,alphagov/trade-tariff-backend,alphagov/trade-tariff-backend,leftees/trade-tariff-backend,leftees/trade-tariff-backend,bitzesty/trade-tariff-backend | ruby | ## Code Before:
class RollbackWorker
include Sidekiq::Worker
sidekiq_options queue: :rollbacks
def perform(date, redownload = false)
TariffSynchronizer.rollback(date, redownload)
end
end
## Instruction:
Change the sidekiq retry job to match the sync schedule.
The sync is run each hour, so we should retry on the same schedule.
If it fails for a day then we should stop trying.
## Code After:
class RollbackWorker
include Sidekiq::Worker
sidekiq_options queue: :rollbacks
# Retry the job for 24 hours, after that the rollback has to be be recreated.
sidekiq_options retry: 24
# Retry the job every hour (the sync runs each hour)
sidekiq_retry_in do |count|
3600
end
def perform(date, redownload = false)
TariffSynchronizer.rollback(date, redownload)
end
end
| class RollbackWorker
include Sidekiq::Worker
sidekiq_options queue: :rollbacks
+ # Retry the job for 24 hours, after that the rollback has to be be recreated.
+ sidekiq_options retry: 24
+
+ # Retry the job every hour (the sync runs each hour)
+ sidekiq_retry_in do |count|
+ 3600
+ end
+
def perform(date, redownload = false)
TariffSynchronizer.rollback(date, redownload)
end
end | 8 | 0.888889 | 8 | 0 |
dc8e98c435400f7a6eb7d450ea4d00253698b81d | spec/hamster/hash/hash_spec.rb | spec/hamster/hash/hash_spec.rb | require 'spec_helper'
require 'hamster/hash'
describe Hamster::Hash do
describe "#new" do
it "values are sufficiently distributed" do
(1..4000).
each_slice(4).
map { |ka, va, kb, vb| Hamster::Hash.new(ka => va, kb => vb).hash }.
uniq.
size.should == 1000
end
it "differs given the same keys and different values" do
Hamster::Hash.new("ka" => "va").hash.should_not == Hamster::Hash.new("ka" => "vb").hash
end
it "differs given the same values and different keys" do
Hamster::Hash.new("ka" => "va").hash.should_not == Hamster::Hash.new("kb" => "va").hash
end
describe "on an empty hash" do
before do
@result = Hamster::Hash.new.hash
end
it "returns 0" do
@result.should == 0
end
end
describe "from a subclass" do
before do
@subclass = Class.new(Hamster::Hash)
@instance = @subclass.new("some" => "values")
end
it "should return an instance of the subclass" do
@instance.class.should be @subclass
end
it "should return a frozen instance" do
@instance.frozen?.should be true
end
end
end
describe "Hamster.hash" do
it "is an alias for Hash.new" do
Hamster.hash(:a => 1, :b => 2).should == Hamster::Hash.new(:a => 1, :b => 2)
end
end
end
| require 'spec_helper'
require 'hamster/hash'
describe Hamster::Hash do
describe "#hash" do
it "values are sufficiently distributed" do
(1..4000).
each_slice(4).
map { |ka, va, kb, vb| Hamster.hash(ka => va, kb => vb).hash }.
uniq.
size.should == 1000
end
it "differs given the same keys and different values" do
Hamster.hash("ka" => "va").hash.should_not == Hamster.hash("ka" => "vb").hash
end
it "differs given the same values and different keys" do
Hamster.hash("ka" => "va").hash.should_not == Hamster.hash("kb" => "va").hash
end
describe "on an empty hash" do
before do
@result = Hamster.hash.hash
end
it "returns 0" do
@result.should == 0
end
end
describe "from a subclass" do
before do
@subclass = Class.new(Hamster::Hash)
@instance = @subclass.new("some" => "values")
end
it "should return an instance of the subclass" do
@instance.class.should be @subclass
end
it "should return a frozen instance" do
@instance.frozen?.should be true
end
end
end
end
| Use `Hash.new` only from subclasses in the specs | Use `Hash.new` only from subclasses in the specs
| Ruby | mit | alexdowad/hamster,dzjuck/hamster,xaviershay/hamster,jack-nie/hamster | ruby | ## Code Before:
require 'spec_helper'
require 'hamster/hash'
describe Hamster::Hash do
describe "#new" do
it "values are sufficiently distributed" do
(1..4000).
each_slice(4).
map { |ka, va, kb, vb| Hamster::Hash.new(ka => va, kb => vb).hash }.
uniq.
size.should == 1000
end
it "differs given the same keys and different values" do
Hamster::Hash.new("ka" => "va").hash.should_not == Hamster::Hash.new("ka" => "vb").hash
end
it "differs given the same values and different keys" do
Hamster::Hash.new("ka" => "va").hash.should_not == Hamster::Hash.new("kb" => "va").hash
end
describe "on an empty hash" do
before do
@result = Hamster::Hash.new.hash
end
it "returns 0" do
@result.should == 0
end
end
describe "from a subclass" do
before do
@subclass = Class.new(Hamster::Hash)
@instance = @subclass.new("some" => "values")
end
it "should return an instance of the subclass" do
@instance.class.should be @subclass
end
it "should return a frozen instance" do
@instance.frozen?.should be true
end
end
end
describe "Hamster.hash" do
it "is an alias for Hash.new" do
Hamster.hash(:a => 1, :b => 2).should == Hamster::Hash.new(:a => 1, :b => 2)
end
end
end
## Instruction:
Use `Hash.new` only from subclasses in the specs
## Code After:
require 'spec_helper'
require 'hamster/hash'
describe Hamster::Hash do
describe "#hash" do
it "values are sufficiently distributed" do
(1..4000).
each_slice(4).
map { |ka, va, kb, vb| Hamster.hash(ka => va, kb => vb).hash }.
uniq.
size.should == 1000
end
it "differs given the same keys and different values" do
Hamster.hash("ka" => "va").hash.should_not == Hamster.hash("ka" => "vb").hash
end
it "differs given the same values and different keys" do
Hamster.hash("ka" => "va").hash.should_not == Hamster.hash("kb" => "va").hash
end
describe "on an empty hash" do
before do
@result = Hamster.hash.hash
end
it "returns 0" do
@result.should == 0
end
end
describe "from a subclass" do
before do
@subclass = Class.new(Hamster::Hash)
@instance = @subclass.new("some" => "values")
end
it "should return an instance of the subclass" do
@instance.class.should be @subclass
end
it "should return a frozen instance" do
@instance.frozen?.should be true
end
end
end
end
| require 'spec_helper'
require 'hamster/hash'
describe Hamster::Hash do
- describe "#new" do
? ^^^
+ describe "#hash" do
? ^^^^
it "values are sufficiently distributed" do
(1..4000).
each_slice(4).
- map { |ka, va, kb, vb| Hamster::Hash.new(ka => va, kb => vb).hash }.
? ^^^ ----
+ map { |ka, va, kb, vb| Hamster.hash(ka => va, kb => vb).hash }.
? ^^
uniq.
size.should == 1000
end
it "differs given the same keys and different values" do
- Hamster::Hash.new("ka" => "va").hash.should_not == Hamster::Hash.new("ka" => "vb").hash
? ^^^ ---- ^^^ ----
+ Hamster.hash("ka" => "va").hash.should_not == Hamster.hash("ka" => "vb").hash
? ^^ ^^
end
it "differs given the same values and different keys" do
- Hamster::Hash.new("ka" => "va").hash.should_not == Hamster::Hash.new("kb" => "va").hash
? ^^^ ---- ^^^ ----
+ Hamster.hash("ka" => "va").hash.should_not == Hamster.hash("kb" => "va").hash
? ^^ ^^
end
describe "on an empty hash" do
before do
- @result = Hamster::Hash.new.hash
? ----------
+ @result = Hamster.hash.hash
? +++++
end
it "returns 0" do
@result.should == 0
end
end
describe "from a subclass" do
before do
@subclass = Class.new(Hamster::Hash)
@instance = @subclass.new("some" => "values")
end
it "should return an instance of the subclass" do
@instance.class.should be @subclass
end
it "should return a frozen instance" do
@instance.frozen?.should be true
end
end
end
- describe "Hamster.hash" do
- it "is an alias for Hash.new" do
- Hamster.hash(:a => 1, :b => 2).should == Hamster::Hash.new(:a => 1, :b => 2)
- end
- end
-
end | 16 | 0.266667 | 5 | 11 |
fd7027ae889d61949998ea02fbb56dbc8e6005a4 | polling_stations/apps/data_importers/management/commands/import_cheltenham.py | polling_stations/apps/data_importers/management/commands/import_cheltenham.py | from data_importers.management.commands import BaseHalaroseCsvImporter
class Command(BaseHalaroseCsvImporter):
council_id = "CHT"
addresses_name = (
"2022-05-05/2022-02-25T12:48:35.558843/polling_station_export-2022-02-25.csv"
)
stations_name = (
"2022-05-05/2022-02-25T12:48:35.558843/polling_station_export-2022-02-25.csv"
)
elections = ["2022-05-05"]
def address_record_to_dict(self, record):
if record.housepostcode in [
"GL50 2RF",
"GL52 6RN",
"GL52 2ES",
"GL53 7AJ",
"GL50 3RB",
"GL53 0HL",
"GL50 2DZ",
]:
return None
return super().address_record_to_dict(record)
| from data_importers.management.commands import BaseHalaroseCsvImporter
class Command(BaseHalaroseCsvImporter):
council_id = "CHT"
addresses_name = (
"2022-05-05/2022-02-25T12:48:35.558843/polling_station_export-2022-02-25.csv"
)
stations_name = (
"2022-05-05/2022-02-25T12:48:35.558843/polling_station_export-2022-02-25.csv"
)
elections = ["2022-05-05"]
def address_record_to_dict(self, record):
if record.housepostcode in [
"GL50 2RF",
"GL52 6RN",
"GL52 2ES",
"GL53 7AJ",
"GL50 3RB",
"GL53 0HL",
"GL50 2DZ",
]:
return None
return super().address_record_to_dict(record)
def station_record_to_dict(self, record):
if record.pollingstationnumber == "191":
record = record._replace(pollingstationaddress_1="")
return super().station_record_to_dict(record)
| Fix to CHT station name | Fix to CHT station name
| Python | bsd-3-clause | DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations | python | ## Code Before:
from data_importers.management.commands import BaseHalaroseCsvImporter
class Command(BaseHalaroseCsvImporter):
council_id = "CHT"
addresses_name = (
"2022-05-05/2022-02-25T12:48:35.558843/polling_station_export-2022-02-25.csv"
)
stations_name = (
"2022-05-05/2022-02-25T12:48:35.558843/polling_station_export-2022-02-25.csv"
)
elections = ["2022-05-05"]
def address_record_to_dict(self, record):
if record.housepostcode in [
"GL50 2RF",
"GL52 6RN",
"GL52 2ES",
"GL53 7AJ",
"GL50 3RB",
"GL53 0HL",
"GL50 2DZ",
]:
return None
return super().address_record_to_dict(record)
## Instruction:
Fix to CHT station name
## Code After:
from data_importers.management.commands import BaseHalaroseCsvImporter
class Command(BaseHalaroseCsvImporter):
council_id = "CHT"
addresses_name = (
"2022-05-05/2022-02-25T12:48:35.558843/polling_station_export-2022-02-25.csv"
)
stations_name = (
"2022-05-05/2022-02-25T12:48:35.558843/polling_station_export-2022-02-25.csv"
)
elections = ["2022-05-05"]
def address_record_to_dict(self, record):
if record.housepostcode in [
"GL50 2RF",
"GL52 6RN",
"GL52 2ES",
"GL53 7AJ",
"GL50 3RB",
"GL53 0HL",
"GL50 2DZ",
]:
return None
return super().address_record_to_dict(record)
def station_record_to_dict(self, record):
if record.pollingstationnumber == "191":
record = record._replace(pollingstationaddress_1="")
return super().station_record_to_dict(record)
| from data_importers.management.commands import BaseHalaroseCsvImporter
class Command(BaseHalaroseCsvImporter):
council_id = "CHT"
addresses_name = (
"2022-05-05/2022-02-25T12:48:35.558843/polling_station_export-2022-02-25.csv"
)
stations_name = (
"2022-05-05/2022-02-25T12:48:35.558843/polling_station_export-2022-02-25.csv"
)
elections = ["2022-05-05"]
def address_record_to_dict(self, record):
if record.housepostcode in [
"GL50 2RF",
"GL52 6RN",
"GL52 2ES",
"GL53 7AJ",
"GL50 3RB",
"GL53 0HL",
"GL50 2DZ",
]:
return None
return super().address_record_to_dict(record)
+
+ def station_record_to_dict(self, record):
+ if record.pollingstationnumber == "191":
+ record = record._replace(pollingstationaddress_1="")
+ return super().station_record_to_dict(record) | 5 | 0.185185 | 5 | 0 |
ee35b772e1bc642314fac43131c87b48c898861f | README.md | README.md |
This README outlines the details of collaborating on this Ember addon.
## Installation
* `git clone <repository-url>` this repository
* `cd ember-cli-addon-docs`
* `npm install`
* `bower install`
## Running
* `ember serve`
* Visit your app at [http://localhost:4200](http://localhost:4200).
## Running Tests
* `npm test` (Runs `ember try:each` to test your addon against multiple Ember versions)
* `ember test`
* `ember test --server`
## Building
* `ember build`
For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
|
This addon has the goal of providing tools for addon developers to easily document and market their addons.
Features planned:
* [ ] Marketing homepage
* [ ] Versioned API documentation
* [ ] Versioned guides
## Installation
* `git clone <repository-url>` this repository
* `cd ember-cli-addon-docs`
* `npm install`
* `bower install`
## Running
* `ember serve`
* Visit your app at [http://localhost:4200](http://localhost:4200).
## Running Tests
* `npm test` (Runs `ember try:each` to test your addon against multiple Ember versions)
* `ember test`
* `ember test --server`
## Building
* `ember build`
For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
| Add a short description of what the project is | Add a short description of what the project is
Fixes #5 | Markdown | mit | ember-learn/ember-cli-addon-docs,ember-learn/ember-cli-addon-docs,ember-learn/ember-cli-addon-docs | markdown | ## Code Before:
This README outlines the details of collaborating on this Ember addon.
## Installation
* `git clone <repository-url>` this repository
* `cd ember-cli-addon-docs`
* `npm install`
* `bower install`
## Running
* `ember serve`
* Visit your app at [http://localhost:4200](http://localhost:4200).
## Running Tests
* `npm test` (Runs `ember try:each` to test your addon against multiple Ember versions)
* `ember test`
* `ember test --server`
## Building
* `ember build`
For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
## Instruction:
Add a short description of what the project is
Fixes #5
## Code After:
This addon has the goal of providing tools for addon developers to easily document and market their addons.
Features planned:
* [ ] Marketing homepage
* [ ] Versioned API documentation
* [ ] Versioned guides
## Installation
* `git clone <repository-url>` this repository
* `cd ember-cli-addon-docs`
* `npm install`
* `bower install`
## Running
* `ember serve`
* Visit your app at [http://localhost:4200](http://localhost:4200).
## Running Tests
* `npm test` (Runs `ember try:each` to test your addon against multiple Ember versions)
* `ember test`
* `ember test --server`
## Building
* `ember build`
For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
|
- This README outlines the details of collaborating on this Ember addon.
+ This addon has the goal of providing tools for addon developers to easily document and market their addons.
+
+ Features planned:
+
+ * [ ] Marketing homepage
+ * [ ] Versioned API documentation
+ * [ ] Versioned guides
## Installation
* `git clone <repository-url>` this repository
* `cd ember-cli-addon-docs`
* `npm install`
* `bower install`
## Running
* `ember serve`
* Visit your app at [http://localhost:4200](http://localhost:4200).
## Running Tests
* `npm test` (Runs `ember try:each` to test your addon against multiple Ember versions)
* `ember test`
* `ember test --server`
## Building
* `ember build`
For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/). | 8 | 0.307692 | 7 | 1 |
d61bd78b1fce5d28a563aa0418a59b333fe49616 | lib/gitlab/client/groups.rb | lib/gitlab/client/groups.rb | class Gitlab::Client
# Defines methods related to groups.
module Groups
def groups
get("/groups")
end
def group(group_id)
get("/groups/#{group_id}")
end
# Creates a new group
#
# @param [String] name
# @param [String] path
def create_group(name, path)
body = {:name => name, :path => path}
post("/groups", :body => body)
end
# Transfers a project to a group
#
# @param [Integer] group_id
# @param [Integer] project_id
def transfer_project_to_group(group_id, project_id)
body = {:id => group_id, :project_id => project_id}
post("/groups/#{group_id}/projects/#{project_id}", :body => body)
end
end
end
| class Gitlab::Client
# Defines methods related to groups.
module Groups
# Gets a list of groups.
#
# @example
# Gitlab.groups
#
# @param [Hash] options A customizable set of options.
# @option options [Integer] :page The page number.
# @option options [Integer] :per_page The number of results per page.
# @return [Array<Gitlab::ObjectifiedHash>]
def groups(options={})
get("/groups", :query => options)
end
def group(group_id)
get("/groups/#{group_id}")
end
# Creates a new group
#
# @param [String] name
# @param [String] path
def create_group(name, path)
body = {:name => name, :path => path}
post("/groups", :body => body)
end
# Transfers a project to a group
#
# @param [Integer] group_id
# @param [Integer] project_id
def transfer_project_to_group(group_id, project_id)
body = {:id => group_id, :project_id => project_id}
post("/groups/#{group_id}/projects/#{project_id}", :body => body)
end
end
end
| Add ability for group api to page results | Add ability for group api to page results
| Ruby | bsd-2-clause | yonglehou/gitlab,nanofi/gitlab,michaellihs/gitlab,marc-ta/gitlab,michaellihs/gitlab,yonglehou/gitlab,agops/gitlab,raine/gitlab,randx/gitlab,NARKOZ/gitlab,marc-ta/gitlab,agops/gitlab,nanofi/gitlab,aaam/gitlab,aaam/gitlab,raine/gitlab,NARKOZ/gitlab,ondra-m/gitlab,ondra-m/gitlab | ruby | ## Code Before:
class Gitlab::Client
# Defines methods related to groups.
module Groups
def groups
get("/groups")
end
def group(group_id)
get("/groups/#{group_id}")
end
# Creates a new group
#
# @param [String] name
# @param [String] path
def create_group(name, path)
body = {:name => name, :path => path}
post("/groups", :body => body)
end
# Transfers a project to a group
#
# @param [Integer] group_id
# @param [Integer] project_id
def transfer_project_to_group(group_id, project_id)
body = {:id => group_id, :project_id => project_id}
post("/groups/#{group_id}/projects/#{project_id}", :body => body)
end
end
end
## Instruction:
Add ability for group api to page results
## Code After:
class Gitlab::Client
# Defines methods related to groups.
module Groups
# Gets a list of groups.
#
# @example
# Gitlab.groups
#
# @param [Hash] options A customizable set of options.
# @option options [Integer] :page The page number.
# @option options [Integer] :per_page The number of results per page.
# @return [Array<Gitlab::ObjectifiedHash>]
def groups(options={})
get("/groups", :query => options)
end
def group(group_id)
get("/groups/#{group_id}")
end
# Creates a new group
#
# @param [String] name
# @param [String] path
def create_group(name, path)
body = {:name => name, :path => path}
post("/groups", :body => body)
end
# Transfers a project to a group
#
# @param [Integer] group_id
# @param [Integer] project_id
def transfer_project_to_group(group_id, project_id)
body = {:id => group_id, :project_id => project_id}
post("/groups/#{group_id}/projects/#{project_id}", :body => body)
end
end
end
| class Gitlab::Client
# Defines methods related to groups.
module Groups
- def groups
- get("/groups")
+
+ # Gets a list of groups.
+ #
+ # @example
+ # Gitlab.groups
+ #
+ # @param [Hash] options A customizable set of options.
+ # @option options [Integer] :page The page number.
+ # @option options [Integer] :per_page The number of results per page.
+ # @return [Array<Gitlab::ObjectifiedHash>]
+ def groups(options={})
+ get("/groups", :query => options)
end
def group(group_id)
get("/groups/#{group_id}")
end
# Creates a new group
#
# @param [String] name
# @param [String] path
def create_group(name, path)
body = {:name => name, :path => path}
post("/groups", :body => body)
end
# Transfers a project to a group
#
# @param [Integer] group_id
# @param [Integer] project_id
def transfer_project_to_group(group_id, project_id)
body = {:id => group_id, :project_id => project_id}
post("/groups/#{group_id}/projects/#{project_id}", :body => body)
end
end
end | 14 | 0.466667 | 12 | 2 |
18ef15bd4f4aa8b80197a63acc76e093c18d8ada | Test/LiveObjectTests.js | Test/LiveObjectTests.js | QUnit.test("CanGetLiveTicks", function(assert) {
var someGame = new TameGame.StandardGame();
var someObject = someGame.createObject();
var someScene = someGame.createScene();
var numTicks = 0;
someScene.addObject(someObject);
someScene.events.onTick(function (tickData) {
++numTicks;
});
someObject.get(TameGame.AliveStatus).isAlive = true;
someGame.startScene(someScene);
someGame.tick(0);
someGame.tick(1000.0);
assert.ok(numTicks > 0, "Got some ticks");
assert.ok(numTicks === 60, "Running at 60 ticks per second");
});
| QUnit.test("CanGetLiveTicks", function(assert) {
var someGame = new TameGame.StandardGame();
var someObject = someGame.createObject();
var someScene = someGame.createScene();
var numTicks = 0;
someScene.addObject(someObject);
someScene.events.onTick(TameGame.UpdatePass.Animations, function (tickData) {
++numTicks;
});
someObject.get(TameGame.AliveStatus).isAlive = true;
someGame.startScene(someScene);
someGame.tick(0);
someGame.tick(999.0);
assert.ok(numTicks > 0, "Got some ticks");
assert.ok(numTicks === 60, "Running at 60 ticks per second");
});
| Work around a rounding error in the 60fps test | Work around a rounding error in the 60fps test
| JavaScript | apache-2.0 | TameGame/Engine,TameGame/Engine,TameGame/Engine | javascript | ## Code Before:
QUnit.test("CanGetLiveTicks", function(assert) {
var someGame = new TameGame.StandardGame();
var someObject = someGame.createObject();
var someScene = someGame.createScene();
var numTicks = 0;
someScene.addObject(someObject);
someScene.events.onTick(function (tickData) {
++numTicks;
});
someObject.get(TameGame.AliveStatus).isAlive = true;
someGame.startScene(someScene);
someGame.tick(0);
someGame.tick(1000.0);
assert.ok(numTicks > 0, "Got some ticks");
assert.ok(numTicks === 60, "Running at 60 ticks per second");
});
## Instruction:
Work around a rounding error in the 60fps test
## Code After:
QUnit.test("CanGetLiveTicks", function(assert) {
var someGame = new TameGame.StandardGame();
var someObject = someGame.createObject();
var someScene = someGame.createScene();
var numTicks = 0;
someScene.addObject(someObject);
someScene.events.onTick(TameGame.UpdatePass.Animations, function (tickData) {
++numTicks;
});
someObject.get(TameGame.AliveStatus).isAlive = true;
someGame.startScene(someScene);
someGame.tick(0);
someGame.tick(999.0);
assert.ok(numTicks > 0, "Got some ticks");
assert.ok(numTicks === 60, "Running at 60 ticks per second");
});
| QUnit.test("CanGetLiveTicks", function(assert) {
var someGame = new TameGame.StandardGame();
var someObject = someGame.createObject();
var someScene = someGame.createScene();
var numTicks = 0;
someScene.addObject(someObject);
- someScene.events.onTick(function (tickData) {
+ someScene.events.onTick(TameGame.UpdatePass.Animations, function (tickData) {
? ++++++++++++++++++++++++++++++++
++numTicks;
});
someObject.get(TameGame.AliveStatus).isAlive = true;
someGame.startScene(someScene);
someGame.tick(0);
- someGame.tick(1000.0);
? ^^^^
+ someGame.tick(999.0);
? ^^^
assert.ok(numTicks > 0, "Got some ticks");
assert.ok(numTicks === 60, "Running at 60 ticks per second");
}); | 4 | 0.2 | 2 | 2 |
fe48256f1ae45c3c5b2f8259eaee42af71ae0ebb | setup.cfg | setup.cfg | [bdist_wheel]
universal = 1
[metadata]
license_file = LICENSE
[flake8]
max-line-length = 100
| [metadata]
license_file = LICENSE
[flake8]
max-line-length = 100
| Remove universal wheel setting: pytest-xdist is Python 3 only | Remove universal wheel setting: pytest-xdist is Python 3 only
| INI | mit | pytest-dev/pytest-xdist,nicoddemus/pytest-xdist | ini | ## Code Before:
[bdist_wheel]
universal = 1
[metadata]
license_file = LICENSE
[flake8]
max-line-length = 100
## Instruction:
Remove universal wheel setting: pytest-xdist is Python 3 only
## Code After:
[metadata]
license_file = LICENSE
[flake8]
max-line-length = 100
| - [bdist_wheel]
- universal = 1
-
[metadata]
license_file = LICENSE
[flake8]
max-line-length = 100 | 3 | 0.375 | 0 | 3 |
bdb9adbeb4a3cf2d38b5922e80e092608953a9fa | meta-oe/recipes-devtools/ctags/ctags_5.9.20210502.0.bb | meta-oe/recipes-devtools/ctags/ctags_5.9.20210502.0.bb |
SUMMARY = "Universal Ctags"
DESCRIPTION = "Universal Ctags is a multilanguage reimplementation of the \
Unix ctags utility. Ctags generates an index of source code \
definitions which is used by numerous editors and utilities \
to instantly locate the definitions."
HOMEPAGE = "https://ctags.io/"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
inherit autotools-brokensep pkgconfig manpages
DEPENDS += "libxml2 jansson libyaml python3-docutils-native"
SRCREV = "6df08b82d4845d1b9420d9268f24d5db16ee4480"
SRC_URI = "git://github.com/universal-ctags/ctags"
S = "${WORKDIR}/git"
#do_install() {
# install -Dm 755 ${B}/ctags ${D}${bindir}/ctags
#}
|
SUMMARY = "Universal Ctags"
DESCRIPTION = "Universal Ctags is a multilanguage reimplementation of the \
Unix ctags utility. Ctags generates an index of source code \
definitions which is used by numerous editors and utilities \
to instantly locate the definitions."
HOMEPAGE = "https://ctags.io/"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
inherit autotools-brokensep pkgconfig manpages
SRCREV = "6df08b82d4845d1b9420d9268f24d5db16ee4480"
SRC_URI = "git://github.com/universal-ctags/ctags"
S = "${WORKDIR}/git"
PACKAGECONFIG ??= " \
readcmd \
xml \
json \
yaml \
"
PACKAGECONFIG[readcmd] = "--enable-readcmd,--disable-readcmd"
PACKAGECONFIG[etags] = "--enable-etags,--disable-etags"
PACKAGECONFIG[xml] = "--enable-xml,--disable-xml,libxml2"
PACKAGECONFIG[json] = "--enable-json,--disable-json,jansson"
PACKAGECONFIG[seccomp] = "--enable-seccomp,--disable-seccomp,libseccomp"
PACKAGECONFIG[yaml] = "--enable-yaml,--disable-yaml,libyaml"
PACKAGECONFIG[manpages] = ",,python3-docutils-native"
| Use PACKAGECONFIG for build options | ctags: Use PACKAGECONFIG for build options
Make the dependencies optional via PACKAGECONFIG where possible to make
it easier for users to enable or disable them as desired. Set the new
PACKAGECONFIG defaults to recreate what was built previously.
The configure script does not have a manpages option, resulting in a
warning:
ctags-5.9.20210502.0-r0 do_configure: QA Issue: ctags: invalid PACKAGECONFIG: manpages [invalid-packageconfig]
The configure script detects if rst2man.py is available, and enables
creating the man pages if found. Add python3-docutils-native as a
dependency only when documentation is requested.
Remove commented code which looks like leftover debugging. The binary is
installed as expected.
Signed-off-by: Robert Joslyn <88e23a0f3c70d5c4600f90fa6517d5c94016ae81@redrectangle.org>
Signed-off-by: Khem Raj <729d64b6f67515e258459a5f6d20ec88b2caf8df@gmail.com>
| BitBake | mit | moto-timo/meta-openembedded,rehsack/meta-openembedded,schnitzeltony/meta-openembedded,schnitzeltony/meta-openembedded,schnitzeltony/meta-openembedded,openembedded/meta-openembedded,rehsack/meta-openembedded,moto-timo/meta-openembedded,schnitzeltony/meta-openembedded,openembedded/meta-openembedded,openembedded/meta-openembedded,schnitzeltony/meta-openembedded,openembedded/meta-openembedded,schnitzeltony/meta-openembedded,moto-timo/meta-openembedded,rehsack/meta-openembedded,moto-timo/meta-openembedded,rehsack/meta-openembedded,openembedded/meta-openembedded,rehsack/meta-openembedded,openembedded/meta-openembedded,rehsack/meta-openembedded,openembedded/meta-openembedded,moto-timo/meta-openembedded,rehsack/meta-openembedded,schnitzeltony/meta-openembedded,openembedded/meta-openembedded | bitbake | ## Code Before:
SUMMARY = "Universal Ctags"
DESCRIPTION = "Universal Ctags is a multilanguage reimplementation of the \
Unix ctags utility. Ctags generates an index of source code \
definitions which is used by numerous editors and utilities \
to instantly locate the definitions."
HOMEPAGE = "https://ctags.io/"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
inherit autotools-brokensep pkgconfig manpages
DEPENDS += "libxml2 jansson libyaml python3-docutils-native"
SRCREV = "6df08b82d4845d1b9420d9268f24d5db16ee4480"
SRC_URI = "git://github.com/universal-ctags/ctags"
S = "${WORKDIR}/git"
#do_install() {
# install -Dm 755 ${B}/ctags ${D}${bindir}/ctags
#}
## Instruction:
ctags: Use PACKAGECONFIG for build options
Make the dependencies optional via PACKAGECONFIG where possible to make
it easier for users to enable or disable them as desired. Set the new
PACKAGECONFIG defaults to recreate what was built previously.
The configure script does not have a manpages option, resulting in a
warning:
ctags-5.9.20210502.0-r0 do_configure: QA Issue: ctags: invalid PACKAGECONFIG: manpages [invalid-packageconfig]
The configure script detects if rst2man.py is available, and enables
creating the man pages if found. Add python3-docutils-native as a
dependency only when documentation is requested.
Remove commented code which looks like leftover debugging. The binary is
installed as expected.
Signed-off-by: Robert Joslyn <88e23a0f3c70d5c4600f90fa6517d5c94016ae81@redrectangle.org>
Signed-off-by: Khem Raj <729d64b6f67515e258459a5f6d20ec88b2caf8df@gmail.com>
## Code After:
SUMMARY = "Universal Ctags"
DESCRIPTION = "Universal Ctags is a multilanguage reimplementation of the \
Unix ctags utility. Ctags generates an index of source code \
definitions which is used by numerous editors and utilities \
to instantly locate the definitions."
HOMEPAGE = "https://ctags.io/"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
inherit autotools-brokensep pkgconfig manpages
SRCREV = "6df08b82d4845d1b9420d9268f24d5db16ee4480"
SRC_URI = "git://github.com/universal-ctags/ctags"
S = "${WORKDIR}/git"
PACKAGECONFIG ??= " \
readcmd \
xml \
json \
yaml \
"
PACKAGECONFIG[readcmd] = "--enable-readcmd,--disable-readcmd"
PACKAGECONFIG[etags] = "--enable-etags,--disable-etags"
PACKAGECONFIG[xml] = "--enable-xml,--disable-xml,libxml2"
PACKAGECONFIG[json] = "--enable-json,--disable-json,jansson"
PACKAGECONFIG[seccomp] = "--enable-seccomp,--disable-seccomp,libseccomp"
PACKAGECONFIG[yaml] = "--enable-yaml,--disable-yaml,libyaml"
PACKAGECONFIG[manpages] = ",,python3-docutils-native"
|
SUMMARY = "Universal Ctags"
DESCRIPTION = "Universal Ctags is a multilanguage reimplementation of the \
Unix ctags utility. Ctags generates an index of source code \
definitions which is used by numerous editors and utilities \
to instantly locate the definitions."
HOMEPAGE = "https://ctags.io/"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
inherit autotools-brokensep pkgconfig manpages
- DEPENDS += "libxml2 jansson libyaml python3-docutils-native"
SRCREV = "6df08b82d4845d1b9420d9268f24d5db16ee4480"
SRC_URI = "git://github.com/universal-ctags/ctags"
S = "${WORKDIR}/git"
- #do_install() {
- # install -Dm 755 ${B}/ctags ${D}${bindir}/ctags
- #}
+ PACKAGECONFIG ??= " \
+ readcmd \
+ xml \
+ json \
+ yaml \
+ "
+ PACKAGECONFIG[readcmd] = "--enable-readcmd,--disable-readcmd"
+ PACKAGECONFIG[etags] = "--enable-etags,--disable-etags"
+ PACKAGECONFIG[xml] = "--enable-xml,--disable-xml,libxml2"
+ PACKAGECONFIG[json] = "--enable-json,--disable-json,jansson"
+ PACKAGECONFIG[seccomp] = "--enable-seccomp,--disable-seccomp,libseccomp"
+ PACKAGECONFIG[yaml] = "--enable-yaml,--disable-yaml,libyaml"
+ PACKAGECONFIG[manpages] = ",,python3-docutils-native" | 17 | 0.73913 | 13 | 4 |
355b60b8c2ae543e10663c0878e142d64cd28957 | build_pyuv_linux.sh | build_pyuv_linux.sh | pip install -d . pyuv
tar -xzf pyuv-*.tar.gz
vagrant up
vagrant ssh x32 -c "cd /vagrant && sh -xe build_pyuv_linux_vagrant.sh"
mv pyuv-*/pyuv.cpython-33m.so pyuv-x86.so
vagrant ssh x64 -c "cd /vagrant && sh -xe build_pyuv_linux_vagrant.sh"
mv pyuv-*/pyuv.cpython-33m.so pyuv.so
| pip install -d . pyuv
tar -xzf pyuv-*.tar.gz
vagrant up
vagrant ssh x32 -c "cd /vagrant && sh -xe build_pyuv_linux_vagrant.sh"
mv pyuv-*/pyuv.cpython-33m.so pyuv-x86.so
vagrant ssh x64 -c "cd /vagrant && sh -xe build_pyuv_linux_vagrant.sh"
mv pyuv-*/pyuv.cpython-33m.so pyuv.so
vagrant halt
| Halt vagrant machines after building. | Halt vagrant machines after building.
| Shell | mit | schlamar/pyuv_build | shell | ## Code Before:
pip install -d . pyuv
tar -xzf pyuv-*.tar.gz
vagrant up
vagrant ssh x32 -c "cd /vagrant && sh -xe build_pyuv_linux_vagrant.sh"
mv pyuv-*/pyuv.cpython-33m.so pyuv-x86.so
vagrant ssh x64 -c "cd /vagrant && sh -xe build_pyuv_linux_vagrant.sh"
mv pyuv-*/pyuv.cpython-33m.so pyuv.so
## Instruction:
Halt vagrant machines after building.
## Code After:
pip install -d . pyuv
tar -xzf pyuv-*.tar.gz
vagrant up
vagrant ssh x32 -c "cd /vagrant && sh -xe build_pyuv_linux_vagrant.sh"
mv pyuv-*/pyuv.cpython-33m.so pyuv-x86.so
vagrant ssh x64 -c "cd /vagrant && sh -xe build_pyuv_linux_vagrant.sh"
mv pyuv-*/pyuv.cpython-33m.so pyuv.so
vagrant halt
| pip install -d . pyuv
tar -xzf pyuv-*.tar.gz
vagrant up
vagrant ssh x32 -c "cd /vagrant && sh -xe build_pyuv_linux_vagrant.sh"
mv pyuv-*/pyuv.cpython-33m.so pyuv-x86.so
vagrant ssh x64 -c "cd /vagrant && sh -xe build_pyuv_linux_vagrant.sh"
mv pyuv-*/pyuv.cpython-33m.so pyuv.so
+ vagrant halt | 1 | 0.142857 | 1 | 0 |
5c17dba19e4655c77de382929ba04329e21856b1 | .travis.yml | .travis.yml | language: python
sudo: false
python:
- '3.4'
- '3.3'
- '3.2'
- '2.7'
- '2.6'
- pypy
- pypy3
install:
- pip install biopython || true
- python setup.py install
- pip install coveralls
- pip install pysam pyvcf
before_script:
- /usr/local/bin/pip install --user biopython
- if [ ! -e "tests/data/genes.fasta" ]; then /usr/bin/python tests/data/download_gene_fasta.py; fi
script: nosetests --with-coverage --cover-package=pyfaidx
deploy:
provider: pypi
user: mdshw5
password:
secure: WaAW6Vk1yjC851PKaeiJGNyZ6wZ2baqlixUSvRDXoT673yFrlp32IMHofmP/TwVxnLMfQxhAb3r7dYYDYnNw4n3vPInJ+Yy35RG1WQ2XUOpOEZ8n2fWczxKfkJjQ5ob03DCSFPeL5h+FYfyHRAfPb9K8OtEawKRvCfaUXE0teko=
on:
all_branches: true
python: 2.6
tags: true
repo: mdshw5/pyfaidx
cache:
- wheelhouse
- tests/data
- pip
after_success:
- coveralls
| language: python
sudo: false
python:
- '3.4'
- '3.3'
- '3.2'
- '2.7'
- '2.6'
- pypy
- pypy3
install:
- pip install biopython || true
- python setup.py install
- pip install coveralls
- pip install pysam || true
- pip install pyvcf
before_script:
- /usr/local/bin/pip install --user biopython
- /usr/bin/python tests/data/download_gene_fasta.py; fi
script: nosetests --with-coverage --cover-package=pyfaidx
deploy:
provider: pypi
user: mdshw5
password:
secure: WaAW6Vk1yjC851PKaeiJGNyZ6wZ2baqlixUSvRDXoT673yFrlp32IMHofmP/TwVxnLMfQxhAb3r7dYYDYnNw4n3vPInJ+Yy35RG1WQ2XUOpOEZ8n2fWczxKfkJjQ5ob03DCSFPeL5h+FYfyHRAfPb9K8OtEawKRvCfaUXE0teko=
on:
all_branches: true
python: 2.6
tags: true
repo: mdshw5/pyfaidx
cache:
- wheelhouse
- tests/data
- pip
after_success:
- coveralls
| Allow pip install pysam to fail on pypy. | Allow pip install pysam to fail on pypy.
| YAML | bsd-3-clause | mattions/pyfaidx | yaml | ## Code Before:
language: python
sudo: false
python:
- '3.4'
- '3.3'
- '3.2'
- '2.7'
- '2.6'
- pypy
- pypy3
install:
- pip install biopython || true
- python setup.py install
- pip install coveralls
- pip install pysam pyvcf
before_script:
- /usr/local/bin/pip install --user biopython
- if [ ! -e "tests/data/genes.fasta" ]; then /usr/bin/python tests/data/download_gene_fasta.py; fi
script: nosetests --with-coverage --cover-package=pyfaidx
deploy:
provider: pypi
user: mdshw5
password:
secure: WaAW6Vk1yjC851PKaeiJGNyZ6wZ2baqlixUSvRDXoT673yFrlp32IMHofmP/TwVxnLMfQxhAb3r7dYYDYnNw4n3vPInJ+Yy35RG1WQ2XUOpOEZ8n2fWczxKfkJjQ5ob03DCSFPeL5h+FYfyHRAfPb9K8OtEawKRvCfaUXE0teko=
on:
all_branches: true
python: 2.6
tags: true
repo: mdshw5/pyfaidx
cache:
- wheelhouse
- tests/data
- pip
after_success:
- coveralls
## Instruction:
Allow pip install pysam to fail on pypy.
## Code After:
language: python
sudo: false
python:
- '3.4'
- '3.3'
- '3.2'
- '2.7'
- '2.6'
- pypy
- pypy3
install:
- pip install biopython || true
- python setup.py install
- pip install coveralls
- pip install pysam || true
- pip install pyvcf
before_script:
- /usr/local/bin/pip install --user biopython
- /usr/bin/python tests/data/download_gene_fasta.py; fi
script: nosetests --with-coverage --cover-package=pyfaidx
deploy:
provider: pypi
user: mdshw5
password:
secure: WaAW6Vk1yjC851PKaeiJGNyZ6wZ2baqlixUSvRDXoT673yFrlp32IMHofmP/TwVxnLMfQxhAb3r7dYYDYnNw4n3vPInJ+Yy35RG1WQ2XUOpOEZ8n2fWczxKfkJjQ5ob03DCSFPeL5h+FYfyHRAfPb9K8OtEawKRvCfaUXE0teko=
on:
all_branches: true
python: 2.6
tags: true
repo: mdshw5/pyfaidx
cache:
- wheelhouse
- tests/data
- pip
after_success:
- coveralls
| language: python
sudo: false
python:
- '3.4'
- '3.3'
- '3.2'
- '2.7'
- '2.6'
- pypy
- pypy3
install:
- pip install biopython || true
- python setup.py install
- pip install coveralls
+ - pip install pysam || true
- - pip install pysam pyvcf
? ------
+ - pip install pyvcf
before_script:
- /usr/local/bin/pip install --user biopython
- - if [ ! -e "tests/data/genes.fasta" ]; then /usr/bin/python tests/data/download_gene_fasta.py; fi
+ - /usr/bin/python tests/data/download_gene_fasta.py; fi
script: nosetests --with-coverage --cover-package=pyfaidx
deploy:
provider: pypi
user: mdshw5
password:
secure: WaAW6Vk1yjC851PKaeiJGNyZ6wZ2baqlixUSvRDXoT673yFrlp32IMHofmP/TwVxnLMfQxhAb3r7dYYDYnNw4n3vPInJ+Yy35RG1WQ2XUOpOEZ8n2fWczxKfkJjQ5ob03DCSFPeL5h+FYfyHRAfPb9K8OtEawKRvCfaUXE0teko=
on:
all_branches: true
python: 2.6
tags: true
repo: mdshw5/pyfaidx
cache:
- wheelhouse
- tests/data
- pip
after_success:
- coveralls | 5 | 0.142857 | 3 | 2 |
b90084431913886d917b16d27f2340f8b58c1205 | README.md | README.md |
First ensure you have the latest version of composer installed.
Run `composer self-update`.
Install this package through Composer. To your `composer.json` file, add:
```js
"require-dev": {
"benepfist/artisan-utility": "dev-master"
}
```
Next, run `composer install --dev` to download it.
Add the service provider to `app/config/app.php`, within the `providers` array.
```php
'providers' => array(
// ...
'Benepfist\ArtisanUtility\ArtisanUtilityServiceProvider',
)
```
Run `php artisan` to view the new laravel:add command:
- **laravel:add --provider="DemoPackage\Demo\DemoServiceProvider"** - Add a new ServiceProvider
- **laravel:add --alias="Demo => DemoPackage\Facade\Demo"** - Add a new Alias | Revert "add travis build status image" | Revert "add travis build status image"
This reverts commit 389617bfcc48abad9d8935dba2c07209c3da3a9b.
| Markdown | mit | benepfist/artisan-utility | markdown | ## Code Before:
https://travis-ci.org/benepfist/artisan-utility.svg?branch=master
## Installation
First ensure you have the latest version of composer installed.
Run `composer self-update`.
Install this package through Composer. To your `composer.json` file, add:
```js
"require-dev": {
"benepfist/artisan-utility": "dev-master"
}
```
Next, run `composer install --dev` to download it.
Add the service provider to `app/config/app.php`, within the `providers` array.
```php
'providers' => array(
// ...
'Benepfist\ArtisanUtility\ArtisanUtilityServiceProvider',
)
```
Run `php artisan` to view the new laravel:add command:
- **laravel:add --provider="DemoPackage\Demo\DemoServiceProvider"** - Add a new ServiceProvider
- **laravel:add --alias="Demo => DemoPackage\Facade\Demo"** - Add a new Alias
## Instruction:
Revert "add travis build status image"
This reverts commit 389617bfcc48abad9d8935dba2c07209c3da3a9b.
## Code After:
First ensure you have the latest version of composer installed.
Run `composer self-update`.
Install this package through Composer. To your `composer.json` file, add:
```js
"require-dev": {
"benepfist/artisan-utility": "dev-master"
}
```
Next, run `composer install --dev` to download it.
Add the service provider to `app/config/app.php`, within the `providers` array.
```php
'providers' => array(
// ...
'Benepfist\ArtisanUtility\ArtisanUtilityServiceProvider',
)
```
Run `php artisan` to view the new laravel:add command:
- **laravel:add --provider="DemoPackage\Demo\DemoServiceProvider"** - Add a new ServiceProvider
- **laravel:add --alias="Demo => DemoPackage\Facade\Demo"** - Add a new Alias | - https://travis-ci.org/benepfist/artisan-utility.svg?branch=master
-
- ## Installation
First ensure you have the latest version of composer installed.
Run `composer self-update`.
Install this package through Composer. To your `composer.json` file, add:
```js
"require-dev": {
"benepfist/artisan-utility": "dev-master"
}
```
Next, run `composer install --dev` to download it.
Add the service provider to `app/config/app.php`, within the `providers` array.
```php
'providers' => array(
// ...
'Benepfist\ArtisanUtility\ArtisanUtilityServiceProvider',
)
```
Run `php artisan` to view the new laravel:add command:
- **laravel:add --provider="DemoPackage\Demo\DemoServiceProvider"** - Add a new ServiceProvider
- **laravel:add --alias="Demo => DemoPackage\Facade\Demo"** - Add a new Alias | 3 | 0.09375 | 0 | 3 | |
5af8b334fc02b439fe60ec137a49b4a39d81ce1e | setup/atlas-cvmfs.sh | setup/atlas-cvmfs.sh | echo -n "setting up ATLAS..."
export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase
. ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh -q
echo " done"
HDF5_ROOT=/afs/cern.ch/user/d/dguest/afswork/public/hdf5/hdf5-1.8.19/install/
echo "set HDF5_ROOT to ${HDF5_ROOT}"
echo "================ setting up CMake ======================"
lsetup cmake
echo "============ setting up AnalysisBaseExternals =========="
asetup AnalysisBaseExternals,21.2.4
echo "====================== Done ============================"
| echo -n "setting up ATLAS..."
export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase
. ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh -q
echo " done"
echo "================ setting up CMake ======================"
lsetup cmake
echo "============ setting up AnalysisBaseExternals =========="
asetup AnalysisBaseExternals,21.2.4
echo "====================== Done ============================"
HDF5_ROOT=/afs/cern.ch/user/d/dguest/afswork/public/hdf5/hdf5-1.8.19/install/
echo "set HDF5_ROOT to ${HDF5_ROOT}"
| Fix for cvmfs setup script | Fix for cvmfs setup script
| Shell | mit | dguest/ttree2hdf5,dguest/ttree2hdf5 | shell | ## Code Before:
echo -n "setting up ATLAS..."
export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase
. ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh -q
echo " done"
HDF5_ROOT=/afs/cern.ch/user/d/dguest/afswork/public/hdf5/hdf5-1.8.19/install/
echo "set HDF5_ROOT to ${HDF5_ROOT}"
echo "================ setting up CMake ======================"
lsetup cmake
echo "============ setting up AnalysisBaseExternals =========="
asetup AnalysisBaseExternals,21.2.4
echo "====================== Done ============================"
## Instruction:
Fix for cvmfs setup script
## Code After:
echo -n "setting up ATLAS..."
export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase
. ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh -q
echo " done"
echo "================ setting up CMake ======================"
lsetup cmake
echo "============ setting up AnalysisBaseExternals =========="
asetup AnalysisBaseExternals,21.2.4
echo "====================== Done ============================"
HDF5_ROOT=/afs/cern.ch/user/d/dguest/afswork/public/hdf5/hdf5-1.8.19/install/
echo "set HDF5_ROOT to ${HDF5_ROOT}"
| echo -n "setting up ATLAS..."
export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase
. ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh -q
echo " done"
-
- HDF5_ROOT=/afs/cern.ch/user/d/dguest/afswork/public/hdf5/hdf5-1.8.19/install/
- echo "set HDF5_ROOT to ${HDF5_ROOT}"
echo "================ setting up CMake ======================"
lsetup cmake
echo "============ setting up AnalysisBaseExternals =========="
asetup AnalysisBaseExternals,21.2.4
echo "====================== Done ============================"
+
+ HDF5_ROOT=/afs/cern.ch/user/d/dguest/afswork/public/hdf5/hdf5-1.8.19/install/
+ echo "set HDF5_ROOT to ${HDF5_ROOT}" | 6 | 0.461538 | 3 | 3 |
c266d9e8ceec776131c82a7bce105495aca59677 | guide/src/contributing.md | guide/src/contributing.md |
Considering contributing to nannou? Awesome! Hopefully this section can guide
you in the right direction.
- [**About the Codebase**](./about-the-codebase.md)
- [**PR Checklist**](./pr-checklist.md)
- [**PR Reviews**](./pr-reviews.md)
- [**Publish New Versions**](./publish-new-versions.md)
## Still have questions?
Remember, if you are still unsure about anything, you probably are not the only
one! Feel free to [open an issue][issue-tracker] with your question.
[issue-tracker]: https://github.com/nannou-org/nannou/issues
|
Considering contributing to nannou? Awesome! Hopefully this section can guide
you in the right direction.
- [**About the Codebase**](./contributing/about-the-codebase.md)
- [**PR Checklist**](./contributing/pr-checklist.md)
- [**PR Reviews**](./contributing/pr-reviews.md)
- [**Publishing New Versions**](./contributing/publishing-new-versions.md)
## Still have questions?
Remember, if you are still unsure about anything, you probably are not the only
one! Feel free to [open an issue][issue-tracker] with your question.
[issue-tracker]: https://github.com/nannou-org/nannou/issues
| Fix broken links in Contributing chapter overview | Fix broken links in Contributing chapter overview
| Markdown | mit | MindBuffer/nannou | markdown | ## Code Before:
Considering contributing to nannou? Awesome! Hopefully this section can guide
you in the right direction.
- [**About the Codebase**](./about-the-codebase.md)
- [**PR Checklist**](./pr-checklist.md)
- [**PR Reviews**](./pr-reviews.md)
- [**Publish New Versions**](./publish-new-versions.md)
## Still have questions?
Remember, if you are still unsure about anything, you probably are not the only
one! Feel free to [open an issue][issue-tracker] with your question.
[issue-tracker]: https://github.com/nannou-org/nannou/issues
## Instruction:
Fix broken links in Contributing chapter overview
## Code After:
Considering contributing to nannou? Awesome! Hopefully this section can guide
you in the right direction.
- [**About the Codebase**](./contributing/about-the-codebase.md)
- [**PR Checklist**](./contributing/pr-checklist.md)
- [**PR Reviews**](./contributing/pr-reviews.md)
- [**Publishing New Versions**](./contributing/publishing-new-versions.md)
## Still have questions?
Remember, if you are still unsure about anything, you probably are not the only
one! Feel free to [open an issue][issue-tracker] with your question.
[issue-tracker]: https://github.com/nannou-org/nannou/issues
|
Considering contributing to nannou? Awesome! Hopefully this section can guide
you in the right direction.
- - [**About the Codebase**](./about-the-codebase.md)
+ - [**About the Codebase**](./contributing/about-the-codebase.md)
? +++++++++++++
- - [**PR Checklist**](./pr-checklist.md)
+ - [**PR Checklist**](./contributing/pr-checklist.md)
? +++++++++++++
- - [**PR Reviews**](./pr-reviews.md)
+ - [**PR Reviews**](./contributing/pr-reviews.md)
? +++++++++++++
- - [**Publish New Versions**](./publish-new-versions.md)
+ - [**Publishing New Versions**](./contributing/publishing-new-versions.md)
? +++ +++++++++++++ +++
## Still have questions?
Remember, if you are still unsure about anything, you probably are not the only
one! Feel free to [open an issue][issue-tracker] with your question.
[issue-tracker]: https://github.com/nannou-org/nannou/issues | 8 | 0.533333 | 4 | 4 |
e8b61c713cdbff32fc05b2da2873aad20532cb14 | src/index.ts | src/index.ts | export * from "./interface";
import {GinBuilder} from "./builder";
export {GinBuilder} from "./builder";
export * from "./enum";
export * from "./filter";
export const gindownloader = new GinBuilder();
| export * from "./interface";
import {GinBuilder} from "./builder";
export {GinBuilder, MangaHereBuilder} from "./builder";
export * from "./enum";
export * from "./filter";
export * from "./parser";
export const gindownloader = new GinBuilder();
export {MangaHereConfig} from "./manga/mangahere/config";
export {RequestRetryStrategy} from "./strategies/retry_strategy";
export {MangaHereParser} from "./manga/mangahere/parser";
export {mangahereLogger} from "./manga/mangahere/logger";
export {MangaHereGenre} from "./manga/mangahere/genre";
export {MangaRequestResult} from "./util/mangaRequestResult";
export {RetryRequestFactory} from "./factories/retryRequest";
| Add 'Hajime-chan is No. 1' to the invalid list | Add 'Hajime-chan is No. 1' to the invalid list
| TypeScript | mit | pikax/gin-downloader,pikax/gin-downloader | typescript | ## Code Before:
export * from "./interface";
import {GinBuilder} from "./builder";
export {GinBuilder} from "./builder";
export * from "./enum";
export * from "./filter";
export const gindownloader = new GinBuilder();
## Instruction:
Add 'Hajime-chan is No. 1' to the invalid list
## Code After:
export * from "./interface";
import {GinBuilder} from "./builder";
export {GinBuilder, MangaHereBuilder} from "./builder";
export * from "./enum";
export * from "./filter";
export * from "./parser";
export const gindownloader = new GinBuilder();
export {MangaHereConfig} from "./manga/mangahere/config";
export {RequestRetryStrategy} from "./strategies/retry_strategy";
export {MangaHereParser} from "./manga/mangahere/parser";
export {mangahereLogger} from "./manga/mangahere/logger";
export {MangaHereGenre} from "./manga/mangahere/genre";
export {MangaRequestResult} from "./util/mangaRequestResult";
export {RetryRequestFactory} from "./factories/retryRequest";
| export * from "./interface";
import {GinBuilder} from "./builder";
- export {GinBuilder} from "./builder";
+ export {GinBuilder, MangaHereBuilder} from "./builder";
? ++++++++++++++++++
export * from "./enum";
export * from "./filter";
+ export * from "./parser";
+
export const gindownloader = new GinBuilder();
+
+
+
+ export {MangaHereConfig} from "./manga/mangahere/config";
+ export {RequestRetryStrategy} from "./strategies/retry_strategy";
+ export {MangaHereParser} from "./manga/mangahere/parser";
+ export {mangahereLogger} from "./manga/mangahere/logger";
+ export {MangaHereGenre} from "./manga/mangahere/genre";
+ export {MangaRequestResult} from "./util/mangaRequestResult";
+ export {RetryRequestFactory} from "./factories/retryRequest"; | 14 | 1.4 | 13 | 1 |
80e2edef3f7aff19dc7981ea89dbbae032025543 | ng_apps/grunt/bgShell.js | ng_apps/grunt/bgShell.js | module.exports = function() {
return {
_defaults: {
bg: false
},
/**
* Clean the app distribution folder.
*/
app_clean: {
execOpts: {
cwd: '.'
},
cmd: 'rm -Rf <%= distScriptsPath %>/*'
},
/**
* Copy app HTML template to distribution folder.
*/
copy_app_template: {
execOpts: {
cwd: '.'
},
cmd: 'cp <%= appMainTemplate %> <%= distPath %>'
},
/*
* Push local (master) branch to remote master. Push to subtree remotes also.
*/
push_2_master: {
execOpts: {
cwd: '../../../'
},
cmd: [
'git push origin master',
'git subtree push -P www/angular angular master',
'git push bitbucket master',
'git subtree push -P www/angular bitbucket_angular master;'
].join(';')
}
};
};
| module.exports = function() {
return {
_defaults: {
bg: false
},
/**
* Clean the app distribution folder.
*/
app_clean: {
execOpts: {
cwd: '.'
},
cmd: 'rm -Rf <%= distScriptsPath %>/*'
},
/**
* Copy app HTML template to distribution folder.
*/
copy_app_template: {
execOpts: {
cwd: '.'
},
cmd: 'cp <%= appMainTemplate %> <%= distPath %>'
},
/*
* Push local (master) branch to remote master. Push to subtree remotes also.
*/
push_2_master: {
execOpts: {
cwd: '../../../'
},
cmd: [
'git push origin master',
'git push bitbucket master',
].join(';')
}
};
};
| Remove subtree push from grunt push-master task. | Remove subtree push from grunt push-master task.
| JavaScript | mit | jojanper/ng-app,jojanper/ng-app | javascript | ## Code Before:
module.exports = function() {
return {
_defaults: {
bg: false
},
/**
* Clean the app distribution folder.
*/
app_clean: {
execOpts: {
cwd: '.'
},
cmd: 'rm -Rf <%= distScriptsPath %>/*'
},
/**
* Copy app HTML template to distribution folder.
*/
copy_app_template: {
execOpts: {
cwd: '.'
},
cmd: 'cp <%= appMainTemplate %> <%= distPath %>'
},
/*
* Push local (master) branch to remote master. Push to subtree remotes also.
*/
push_2_master: {
execOpts: {
cwd: '../../../'
},
cmd: [
'git push origin master',
'git subtree push -P www/angular angular master',
'git push bitbucket master',
'git subtree push -P www/angular bitbucket_angular master;'
].join(';')
}
};
};
## Instruction:
Remove subtree push from grunt push-master task.
## Code After:
module.exports = function() {
return {
_defaults: {
bg: false
},
/**
* Clean the app distribution folder.
*/
app_clean: {
execOpts: {
cwd: '.'
},
cmd: 'rm -Rf <%= distScriptsPath %>/*'
},
/**
* Copy app HTML template to distribution folder.
*/
copy_app_template: {
execOpts: {
cwd: '.'
},
cmd: 'cp <%= appMainTemplate %> <%= distPath %>'
},
/*
* Push local (master) branch to remote master. Push to subtree remotes also.
*/
push_2_master: {
execOpts: {
cwd: '../../../'
},
cmd: [
'git push origin master',
'git push bitbucket master',
].join(';')
}
};
};
| module.exports = function() {
return {
_defaults: {
bg: false
},
/**
* Clean the app distribution folder.
*/
app_clean: {
execOpts: {
cwd: '.'
},
cmd: 'rm -Rf <%= distScriptsPath %>/*'
},
/**
* Copy app HTML template to distribution folder.
*/
copy_app_template: {
execOpts: {
cwd: '.'
},
cmd: 'cp <%= appMainTemplate %> <%= distPath %>'
},
/*
* Push local (master) branch to remote master. Push to subtree remotes also.
*/
push_2_master: {
execOpts: {
cwd: '../../../'
},
cmd: [
'git push origin master',
- 'git subtree push -P www/angular angular master',
'git push bitbucket master',
- 'git subtree push -P www/angular bitbucket_angular master;'
].join(';')
}
};
}; | 2 | 0.047619 | 0 | 2 |
4b469393fb0c87f498757e59f99d0a580c00b435 | pykeg/templates/kegweb/page_block.html | pykeg/templates/kegweb/page_block.html | <div class="contenthead">
{{ page.title }}
</div>
<div class="content">
{% ifequal page.markup "markdown" %}
{% load markup %}
{{ page.content|markdown }}
{% else %}
{% ifequal page.markup "plaintext" %}
{{ page.content|linebreaks|urlize }}
{% else %}
{{ page.content }}
{% endifequal %}
{% endifequal %}
</div>
| <div class="contenthead">
{{ page.title }}
</div>
<div class="content">
{% ifequal page.markup "markdown" %}
{% load markup %}
{{ page.content|markdown }}
{% else %}
{% ifequal page.markup "html" %}
{{ page.content|safe }}
{% else %}
{{ page.content|linebreaks|urlize }}
{% endifequal %}
{% endifequal %}
</div>
| Fix html markup for page rendering. | Fix html markup for page rendering.
| HTML | mit | Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server | html | ## Code Before:
<div class="contenthead">
{{ page.title }}
</div>
<div class="content">
{% ifequal page.markup "markdown" %}
{% load markup %}
{{ page.content|markdown }}
{% else %}
{% ifequal page.markup "plaintext" %}
{{ page.content|linebreaks|urlize }}
{% else %}
{{ page.content }}
{% endifequal %}
{% endifequal %}
</div>
## Instruction:
Fix html markup for page rendering.
## Code After:
<div class="contenthead">
{{ page.title }}
</div>
<div class="content">
{% ifequal page.markup "markdown" %}
{% load markup %}
{{ page.content|markdown }}
{% else %}
{% ifequal page.markup "html" %}
{{ page.content|safe }}
{% else %}
{{ page.content|linebreaks|urlize }}
{% endifequal %}
{% endifequal %}
</div>
| <div class="contenthead">
{{ page.title }}
</div>
<div class="content">
{% ifequal page.markup "markdown" %}
{% load markup %}
{{ page.content|markdown }}
{% else %}
- {% ifequal page.markup "plaintext" %}
? ^ -------
+ {% ifequal page.markup "html" %}
? ^^^
+ {{ page.content|safe }}
+ {% else %}
{{ page.content|linebreaks|urlize }}
- {% else %}
- {{ page.content }}
{% endifequal %}
{% endifequal %}
</div>
| 6 | 0.352941 | 3 | 3 |
96a1279084b4cb639ac96da74d95e48b4cbb7ada | composer.json | composer.json | {
"name": "bearframework/bearframework",
"description": "PHP framework",
"keywords": ["framework", "routing", "error handling", "logging"],
"homepage": "https://github.com/bearframework/bearframework",
"license": "MIT",
"authors": [
{
"name": "Ivo Petkov",
"email": "ivo@ivopetkov.com",
"homepage": "http://ivopetkov.com"
}
],
"require": {
"php": ">=5.5.0",
"ivopetkov/object-storage": "*",
"ivopetkov/html-server-components-compiler": "*"
},
"autoload": {
"psr-4": {
"": "src/"
}
}
} | {
"name": "bearframework/bearframework",
"description": "PHP framework",
"keywords": ["framework", "routing", "error handling", "logging"],
"homepage": "https://github.com/bearframework/bearframework",
"license": "MIT",
"authors": [
{
"name": "Ivo Petkov",
"email": "ivo@ivopetkov.com",
"homepage": "http://ivopetkov.com"
}
],
"require": {
"php": ">=5.5.0",
"ivopetkov/object-storage": "*",
"ivopetkov/html-server-components-compiler": "*"
},
"require-dev": {
"phpunit/phpunit": "^4.8"
},
"autoload": {
"psr-4": {
"": "src/"
}
}
}
| Add phpunit to dev dependencies | Add phpunit to dev dependencies
| JSON | mit | bearframework/bearframework,mirovit/bearframework | json | ## Code Before:
{
"name": "bearframework/bearframework",
"description": "PHP framework",
"keywords": ["framework", "routing", "error handling", "logging"],
"homepage": "https://github.com/bearframework/bearframework",
"license": "MIT",
"authors": [
{
"name": "Ivo Petkov",
"email": "ivo@ivopetkov.com",
"homepage": "http://ivopetkov.com"
}
],
"require": {
"php": ">=5.5.0",
"ivopetkov/object-storage": "*",
"ivopetkov/html-server-components-compiler": "*"
},
"autoload": {
"psr-4": {
"": "src/"
}
}
}
## Instruction:
Add phpunit to dev dependencies
## Code After:
{
"name": "bearframework/bearframework",
"description": "PHP framework",
"keywords": ["framework", "routing", "error handling", "logging"],
"homepage": "https://github.com/bearframework/bearframework",
"license": "MIT",
"authors": [
{
"name": "Ivo Petkov",
"email": "ivo@ivopetkov.com",
"homepage": "http://ivopetkov.com"
}
],
"require": {
"php": ">=5.5.0",
"ivopetkov/object-storage": "*",
"ivopetkov/html-server-components-compiler": "*"
},
"require-dev": {
"phpunit/phpunit": "^4.8"
},
"autoload": {
"psr-4": {
"": "src/"
}
}
}
| {
"name": "bearframework/bearframework",
"description": "PHP framework",
"keywords": ["framework", "routing", "error handling", "logging"],
"homepage": "https://github.com/bearframework/bearframework",
"license": "MIT",
"authors": [
{
"name": "Ivo Petkov",
"email": "ivo@ivopetkov.com",
"homepage": "http://ivopetkov.com"
}
],
"require": {
"php": ">=5.5.0",
"ivopetkov/object-storage": "*",
"ivopetkov/html-server-components-compiler": "*"
},
+ "require-dev": {
+ "phpunit/phpunit": "^4.8"
+ },
"autoload": {
"psr-4": {
"": "src/"
}
}
} | 3 | 0.125 | 3 | 0 |
55d974eb0e979427e769b092c97a3dcb37880d0d | README.md | README.md | Terra Examples
==============
A repository of example [Terra](http://terralang.org) programs
- You can play around with the code in the Terra REPL: `terra -i file.t`
evaluates the contents of `file.t` and enters the REPL.
- Every Terra function `f` can be pretty-printed with `f:printpretty()` and
disassembled with `f:disas()`, which shows the function's LLVM IR and
assembly.
- Tested with Terra release [2016-03-25](
https://github.com/zdevito/terra/releases/tag/release-2016-03-25)
| Terra Examples
==============
A repository of example [Terra](http://terralang.org) programs
- You can play around with the code in the Terra REPL: `terra -i file.t`
evaluates the contents of `file.t` and enters the REPL.
- Every Terra function `f` can be pretty-printed with `f:printpretty()` and
disassembled with `f:disas()`, which shows the function's LLVM IR and
assembly.
- Tested with Terra [1.0.0-rc1](https://github.com/terralang/terra/releases/tag/release-1.0.0-rc1)
References
----------
- [On the State of Terra in 2022](https://elliottslaughter.com/2022/05/state-of-terra)
| Test examples with Terra 1.0.0-rc1 | Test examples with Terra 1.0.0-rc1
| Markdown | mit | aprell/terra-examples | markdown | ## Code Before:
Terra Examples
==============
A repository of example [Terra](http://terralang.org) programs
- You can play around with the code in the Terra REPL: `terra -i file.t`
evaluates the contents of `file.t` and enters the REPL.
- Every Terra function `f` can be pretty-printed with `f:printpretty()` and
disassembled with `f:disas()`, which shows the function's LLVM IR and
assembly.
- Tested with Terra release [2016-03-25](
https://github.com/zdevito/terra/releases/tag/release-2016-03-25)
## Instruction:
Test examples with Terra 1.0.0-rc1
## Code After:
Terra Examples
==============
A repository of example [Terra](http://terralang.org) programs
- You can play around with the code in the Terra REPL: `terra -i file.t`
evaluates the contents of `file.t` and enters the REPL.
- Every Terra function `f` can be pretty-printed with `f:printpretty()` and
disassembled with `f:disas()`, which shows the function's LLVM IR and
assembly.
- Tested with Terra [1.0.0-rc1](https://github.com/terralang/terra/releases/tag/release-1.0.0-rc1)
References
----------
- [On the State of Terra in 2022](https://elliottslaughter.com/2022/05/state-of-terra)
| Terra Examples
==============
A repository of example [Terra](http://terralang.org) programs
- You can play around with the code in the Terra REPL: `terra -i file.t`
evaluates the contents of `file.t` and enters the REPL.
- Every Terra function `f` can be pretty-printed with `f:printpretty()` and
disassembled with `f:disas()`, which shows the function's LLVM IR and
assembly.
- - Tested with Terra release [2016-03-25](
- https://github.com/zdevito/terra/releases/tag/release-2016-03-25)
+ - Tested with Terra [1.0.0-rc1](https://github.com/terralang/terra/releases/tag/release-1.0.0-rc1)
+
+ References
+ ----------
+
+ - [On the State of Terra in 2022](https://elliottslaughter.com/2022/05/state-of-terra) | 8 | 0.571429 | 6 | 2 |
c4fc5f2902ca6efe8b16a2dd35e6f3b9d0279fe5 | ktor-client/ktor-client-core/src/io/ktor/client/HttpClientFactory.kt | ktor-client/ktor-client-core/src/io/ktor/client/HttpClientFactory.kt | package io.ktor.client
import io.ktor.client.backend.*
import io.ktor.client.call.*
import io.ktor.client.features.*
import io.ktor.client.request.*
import io.ktor.client.response.*
import io.ktor.client.utils.*
object HttpClientFactory {
fun createDefault(backendFactory: HttpClientBackendFactory, block: ClientConfig.() -> Unit = {}): HttpClient {
val backend = backendFactory {}
return ClientConfig(backend).apply {
install("backend") {
requestPipeline.intercept(HttpRequestPipeline.Send) { builder ->
val request = (builder as? HttpRequestBuilder)?.build() ?: return@intercept
if (request.body !is HttpMessageBody) error("Body can't be processed: ${request.body}")
val response = backend.makeRequest(request)
proceedWith(HttpClientCall(request, response, context))
}
responsePipeline.intercept(HttpResponsePipeline.After) { container ->
container.response.close()
}
}
install(HttpPlainText)
install(HttpIgnoreBody)
block()
}.build()
}
}
| package io.ktor.client
import io.ktor.client.backend.*
import io.ktor.client.call.*
import io.ktor.client.features.*
import io.ktor.client.request.*
import io.ktor.client.response.*
import io.ktor.client.utils.*
object HttpClientFactory {
fun createDefault(backendFactory: HttpClientBackendFactory, block: ClientConfig.() -> Unit = {}): HttpClient {
val backend = backendFactory {}
return ClientConfig(backend).apply {
install("backend") {
requestPipeline.intercept(HttpRequestPipeline.Send) { builder ->
val request = (builder as? HttpRequestBuilder)?.build() ?: return@intercept
if (request.body !is HttpMessageBody) error("Body can't be processed: ${request.body}")
val response = backend.makeRequest(request)
if (response.body !is HttpMessageBody) error("Client backend response has wrong format: ${request.body}")
proceedWith(HttpClientCall(request, response, context))
}
responsePipeline.intercept(HttpResponsePipeline.After) { container ->
container.response.close()
}
}
install(HttpPlainText)
install(HttpIgnoreBody)
block()
}.build()
}
}
| Check body type in backend response | Check body type in backend response
| Kotlin | apache-2.0 | ktorio/ktor,ktorio/ktor,ktorio/ktor,ktorio/ktor | kotlin | ## Code Before:
package io.ktor.client
import io.ktor.client.backend.*
import io.ktor.client.call.*
import io.ktor.client.features.*
import io.ktor.client.request.*
import io.ktor.client.response.*
import io.ktor.client.utils.*
object HttpClientFactory {
fun createDefault(backendFactory: HttpClientBackendFactory, block: ClientConfig.() -> Unit = {}): HttpClient {
val backend = backendFactory {}
return ClientConfig(backend).apply {
install("backend") {
requestPipeline.intercept(HttpRequestPipeline.Send) { builder ->
val request = (builder as? HttpRequestBuilder)?.build() ?: return@intercept
if (request.body !is HttpMessageBody) error("Body can't be processed: ${request.body}")
val response = backend.makeRequest(request)
proceedWith(HttpClientCall(request, response, context))
}
responsePipeline.intercept(HttpResponsePipeline.After) { container ->
container.response.close()
}
}
install(HttpPlainText)
install(HttpIgnoreBody)
block()
}.build()
}
}
## Instruction:
Check body type in backend response
## Code After:
package io.ktor.client
import io.ktor.client.backend.*
import io.ktor.client.call.*
import io.ktor.client.features.*
import io.ktor.client.request.*
import io.ktor.client.response.*
import io.ktor.client.utils.*
object HttpClientFactory {
fun createDefault(backendFactory: HttpClientBackendFactory, block: ClientConfig.() -> Unit = {}): HttpClient {
val backend = backendFactory {}
return ClientConfig(backend).apply {
install("backend") {
requestPipeline.intercept(HttpRequestPipeline.Send) { builder ->
val request = (builder as? HttpRequestBuilder)?.build() ?: return@intercept
if (request.body !is HttpMessageBody) error("Body can't be processed: ${request.body}")
val response = backend.makeRequest(request)
if (response.body !is HttpMessageBody) error("Client backend response has wrong format: ${request.body}")
proceedWith(HttpClientCall(request, response, context))
}
responsePipeline.intercept(HttpResponsePipeline.After) { container ->
container.response.close()
}
}
install(HttpPlainText)
install(HttpIgnoreBody)
block()
}.build()
}
}
| package io.ktor.client
import io.ktor.client.backend.*
import io.ktor.client.call.*
import io.ktor.client.features.*
import io.ktor.client.request.*
import io.ktor.client.response.*
import io.ktor.client.utils.*
object HttpClientFactory {
fun createDefault(backendFactory: HttpClientBackendFactory, block: ClientConfig.() -> Unit = {}): HttpClient {
val backend = backendFactory {}
return ClientConfig(backend).apply {
install("backend") {
requestPipeline.intercept(HttpRequestPipeline.Send) { builder ->
val request = (builder as? HttpRequestBuilder)?.build() ?: return@intercept
+
if (request.body !is HttpMessageBody) error("Body can't be processed: ${request.body}")
+ val response = backend.makeRequest(request)
+ if (response.body !is HttpMessageBody) error("Client backend response has wrong format: ${request.body}")
- val response = backend.makeRequest(request)
proceedWith(HttpClientCall(request, response, context))
}
responsePipeline.intercept(HttpResponsePipeline.After) { container ->
container.response.close()
}
}
install(HttpPlainText)
install(HttpIgnoreBody)
block()
}.build()
}
} | 4 | 0.114286 | 3 | 1 |
e42611ca417d83560d7795cfe7d3b8bebeede463 | CHANGELOG.md | CHANGELOG.md |
* Variant `PictureType::DuringPerformace` to
`PictureType::DuringPerformance`, there was a missing "n"
## [0.2.0] - 2016-02-06
### Added
* Example for displaying FLAC metadata
* Alias for `Stream<P: StreamProducer>`. `StreamReader<R: Read>` for
`Stream<ReadStream<R: Read>>` and `StreamBuffer` for
`Stream<ByteStream>`
### Fixed
* Infinite loop in Rust beta
([#2](https://github.com/sourrust/flac/issues/2))
* Out of memory error on Linux
([#3](https://github.com/sourrust/flac/issues/3))
## 0.1.0 - 2016-01-08
### Added
* API for dealing with metadata
* Complete parsing of FLAC files
* Complete decoding of FLAC files
* Example decoder from FLAC to WAV
[Unreleased]: https://github.com/sourrust/flac/compare/v0.2.0...HEAD
[0.2.0]: https://github.com/sourrust/flac/compare/v0.1.0...v0.2.0
|
* Method field `length` is now private
* Metadata field `is_last` is now private in favor of the method
`Method::is_last`
* Variant `PictureType::DuringPerformace` to
`PictureType::DuringPerformance`, there was a missing "n"
## [0.2.0] - 2016-02-06
### Added
* Example for displaying FLAC metadata
* Alias for `Stream<P: StreamProducer>`. `StreamReader<R: Read>` for
`Stream<ReadStream<R: Read>>` and `StreamBuffer` for
`Stream<ByteStream>`
### Fixed
* Infinite loop in Rust beta
([#2](https://github.com/sourrust/flac/issues/2))
* Out of memory error on Linux
([#3](https://github.com/sourrust/flac/issues/3))
## 0.1.0 - 2016-01-08
### Added
* API for dealing with metadata
* Complete parsing of FLAC files
* Complete decoding of FLAC files
* Example decoder from FLAC to WAV
[Unreleased]: https://github.com/sourrust/flac/compare/v0.2.0...HEAD
[0.2.0]: https://github.com/sourrust/flac/compare/v0.1.0...v0.2.0
| Add the other items that have changed | Add the other items that have changed
| Markdown | bsd-3-clause | sourrust/flac | markdown | ## Code Before:
* Variant `PictureType::DuringPerformace` to
`PictureType::DuringPerformance`, there was a missing "n"
## [0.2.0] - 2016-02-06
### Added
* Example for displaying FLAC metadata
* Alias for `Stream<P: StreamProducer>`. `StreamReader<R: Read>` for
`Stream<ReadStream<R: Read>>` and `StreamBuffer` for
`Stream<ByteStream>`
### Fixed
* Infinite loop in Rust beta
([#2](https://github.com/sourrust/flac/issues/2))
* Out of memory error on Linux
([#3](https://github.com/sourrust/flac/issues/3))
## 0.1.0 - 2016-01-08
### Added
* API for dealing with metadata
* Complete parsing of FLAC files
* Complete decoding of FLAC files
* Example decoder from FLAC to WAV
[Unreleased]: https://github.com/sourrust/flac/compare/v0.2.0...HEAD
[0.2.0]: https://github.com/sourrust/flac/compare/v0.1.0...v0.2.0
## Instruction:
Add the other items that have changed
## Code After:
* Method field `length` is now private
* Metadata field `is_last` is now private in favor of the method
`Method::is_last`
* Variant `PictureType::DuringPerformace` to
`PictureType::DuringPerformance`, there was a missing "n"
## [0.2.0] - 2016-02-06
### Added
* Example for displaying FLAC metadata
* Alias for `Stream<P: StreamProducer>`. `StreamReader<R: Read>` for
`Stream<ReadStream<R: Read>>` and `StreamBuffer` for
`Stream<ByteStream>`
### Fixed
* Infinite loop in Rust beta
([#2](https://github.com/sourrust/flac/issues/2))
* Out of memory error on Linux
([#3](https://github.com/sourrust/flac/issues/3))
## 0.1.0 - 2016-01-08
### Added
* API for dealing with metadata
* Complete parsing of FLAC files
* Complete decoding of FLAC files
* Example decoder from FLAC to WAV
[Unreleased]: https://github.com/sourrust/flac/compare/v0.2.0...HEAD
[0.2.0]: https://github.com/sourrust/flac/compare/v0.1.0...v0.2.0
|
+ * Method field `length` is now private
+ * Metadata field `is_last` is now private in favor of the method
+ `Method::is_last`
* Variant `PictureType::DuringPerformace` to
`PictureType::DuringPerformance`, there was a missing "n"
## [0.2.0] - 2016-02-06
### Added
* Example for displaying FLAC metadata
* Alias for `Stream<P: StreamProducer>`. `StreamReader<R: Read>` for
`Stream<ReadStream<R: Read>>` and `StreamBuffer` for
`Stream<ByteStream>`
### Fixed
* Infinite loop in Rust beta
([#2](https://github.com/sourrust/flac/issues/2))
* Out of memory error on Linux
([#3](https://github.com/sourrust/flac/issues/3))
## 0.1.0 - 2016-01-08
### Added
* API for dealing with metadata
* Complete parsing of FLAC files
* Complete decoding of FLAC files
* Example decoder from FLAC to WAV
[Unreleased]: https://github.com/sourrust/flac/compare/v0.2.0...HEAD
[0.2.0]: https://github.com/sourrust/flac/compare/v0.1.0...v0.2.0 | 3 | 0.096774 | 3 | 0 |
6b06ff67097d0a2ef639df4a3d9baf4f6677b5fd | lmj/sim/__init__.py | lmj/sim/__init__.py |
'''Yet another OpenGL-and-physics simulator framework !'''
from . import ode
from .log import enable_default_logging, get_logger
from .ode import make_quaternion
from .world import Viewer, World
import plac
def call(main):
'''Enable logging and start up a main method.'''
enable_default_logging()
plac.call(main)
args = plac.annotations
|
'''Yet another OpenGL-and-physics simulator framework !'''
from . import physics
from .log import enable_default_logging, get_logger
from .world import Viewer, World
import plac
def call(main):
'''Enable logging and start up a main method.'''
enable_default_logging()
plac.call(main)
args = plac.annotations
| Update package imports for module name change. | Update package imports for module name change.
| Python | mit | EmbodiedCognition/pagoda,EmbodiedCognition/pagoda | python | ## Code Before:
'''Yet another OpenGL-and-physics simulator framework !'''
from . import ode
from .log import enable_default_logging, get_logger
from .ode import make_quaternion
from .world import Viewer, World
import plac
def call(main):
'''Enable logging and start up a main method.'''
enable_default_logging()
plac.call(main)
args = plac.annotations
## Instruction:
Update package imports for module name change.
## Code After:
'''Yet another OpenGL-and-physics simulator framework !'''
from . import physics
from .log import enable_default_logging, get_logger
from .world import Viewer, World
import plac
def call(main):
'''Enable logging and start up a main method.'''
enable_default_logging()
plac.call(main)
args = plac.annotations
|
'''Yet another OpenGL-and-physics simulator framework !'''
- from . import ode
+ from . import physics
from .log import enable_default_logging, get_logger
- from .ode import make_quaternion
from .world import Viewer, World
import plac
def call(main):
'''Enable logging and start up a main method.'''
enable_default_logging()
plac.call(main)
args = plac.annotations | 3 | 0.1875 | 1 | 2 |
a1bfb35bb5865cc45aded58b7cffab6da7cc0baf | pykeg/settings.py | pykeg/settings.py |
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.humanize',
'django.contrib.markup',
'pykeg.core',
)
AUTH_PROFILE_MODULE = "core.UserProfile"
try:
import common_settings
from common_settings import *
except ImportError:
print 'Error: Could not find common_settings.py'
print 'Most likely, this means kegbot has not been configured properly.'
print 'Consult setup documentation. Exiting...'
import sys
sys.exit(1)
|
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.humanize',
'django.contrib.markup',
'pykeg.core',
'pykeg.contrib.twitter',
)
AUTH_PROFILE_MODULE = "core.UserProfile"
try:
import common_settings
from common_settings import *
except ImportError:
print 'Error: Could not find common_settings.py'
print 'Most likely, this means kegbot has not been configured properly.'
print 'Consult setup documentation. Exiting...'
import sys
sys.exit(1)
| Add twitter to default apps. | Add twitter to default apps.
| Python | mit | Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server | python | ## Code Before:
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.humanize',
'django.contrib.markup',
'pykeg.core',
)
AUTH_PROFILE_MODULE = "core.UserProfile"
try:
import common_settings
from common_settings import *
except ImportError:
print 'Error: Could not find common_settings.py'
print 'Most likely, this means kegbot has not been configured properly.'
print 'Consult setup documentation. Exiting...'
import sys
sys.exit(1)
## Instruction:
Add twitter to default apps.
## Code After:
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.humanize',
'django.contrib.markup',
'pykeg.core',
'pykeg.contrib.twitter',
)
AUTH_PROFILE_MODULE = "core.UserProfile"
try:
import common_settings
from common_settings import *
except ImportError:
print 'Error: Could not find common_settings.py'
print 'Most likely, this means kegbot has not been configured properly.'
print 'Consult setup documentation. Exiting...'
import sys
sys.exit(1)
|
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.humanize',
'django.contrib.markup',
'pykeg.core',
+ 'pykeg.contrib.twitter',
)
AUTH_PROFILE_MODULE = "core.UserProfile"
try:
import common_settings
from common_settings import *
except ImportError:
print 'Error: Could not find common_settings.py'
print 'Most likely, this means kegbot has not been configured properly.'
print 'Consult setup documentation. Exiting...'
import sys
sys.exit(1) | 1 | 0.043478 | 1 | 0 |
4ef470fe9b0d65d730135390bb45bc8c22900ca4 | vendor/assets/stylesheets/jquery.jorgchart.css | vendor/assets/stylesheets/jquery.jorgchart.css | /* Basic styling */
/* Draw the lines */
.jOrgChart .line {
height : 20px;
width : 4px;
}
.jOrgChart .down {
background-color : black;
margin : 0px auto;
}
.jOrgChart .top {
border-top : 3px solid black;
}
.jOrgChart .left {
border-right : 2px solid black;
}
.jOrgChart .right {
border-left : 2px solid black;
}
/* node cell */
.jOrgChart td {
text-align : center;
vertical-align : top;
padding : 0;
}
/* The node */
.jOrgChart .node {
background-color : #35363B;
display : inline-block;
width : 96px;
height : 60px;
z-index : 10;
margin : 0 2px;
}
/* jQuery drag 'n drop */
.drag-active {
border-style : dotted !important;
}
.drop-hover {
border-style : solid !important;
border-color : #E05E00 !important;
}
| /* Basic styling */
/* Draw the lines */
.jOrgChart .line {
height: 20px;
width: 50%;
}
.jOrgChart .down {
background-color: black;
width: 2px;
margin: 0px auto;
}
.jOrgChart .top {
border-top: 2px solid black;
}
.jOrgChart .left {
border-right: 1px solid black;
}
.jOrgChart .right {
border-left: 1px solid black;
}
/* node cell */
.jOrgChart td {
text-align: center;
vertical-align: top;
padding: 0;
margin: 0;
float: none;
border: none;
}
.jOrgChart tr, .jOrgChart table {
border: none;
}
.jOrgChart table {
border-collapse: separate;
border-spacing: 0;
}
/* The node */
.jOrgChart .node {
background-color: #fff;
border: 1px solid black;
display: inline-block;
width: 96px;
height: 60px;
z-index: 10;
margin: 0 2px;
}
/* jQuery drag 'n drop */
.drag-active {
border-style: dotted !important;
}
.drop-hover {
border-style: solid !important;
border-color: #f00 !important;
}
| Modify CSS to prevent conflicts with existing stylesheets | Modify CSS to prevent conflicts with existing stylesheets
| CSS | mit | gdott9/jorgchart-rails | css | ## Code Before:
/* Basic styling */
/* Draw the lines */
.jOrgChart .line {
height : 20px;
width : 4px;
}
.jOrgChart .down {
background-color : black;
margin : 0px auto;
}
.jOrgChart .top {
border-top : 3px solid black;
}
.jOrgChart .left {
border-right : 2px solid black;
}
.jOrgChart .right {
border-left : 2px solid black;
}
/* node cell */
.jOrgChart td {
text-align : center;
vertical-align : top;
padding : 0;
}
/* The node */
.jOrgChart .node {
background-color : #35363B;
display : inline-block;
width : 96px;
height : 60px;
z-index : 10;
margin : 0 2px;
}
/* jQuery drag 'n drop */
.drag-active {
border-style : dotted !important;
}
.drop-hover {
border-style : solid !important;
border-color : #E05E00 !important;
}
## Instruction:
Modify CSS to prevent conflicts with existing stylesheets
## Code After:
/* Basic styling */
/* Draw the lines */
.jOrgChart .line {
height: 20px;
width: 50%;
}
.jOrgChart .down {
background-color: black;
width: 2px;
margin: 0px auto;
}
.jOrgChart .top {
border-top: 2px solid black;
}
.jOrgChart .left {
border-right: 1px solid black;
}
.jOrgChart .right {
border-left: 1px solid black;
}
/* node cell */
.jOrgChart td {
text-align: center;
vertical-align: top;
padding: 0;
margin: 0;
float: none;
border: none;
}
.jOrgChart tr, .jOrgChart table {
border: none;
}
.jOrgChart table {
border-collapse: separate;
border-spacing: 0;
}
/* The node */
.jOrgChart .node {
background-color: #fff;
border: 1px solid black;
display: inline-block;
width: 96px;
height: 60px;
z-index: 10;
margin: 0 2px;
}
/* jQuery drag 'n drop */
.drag-active {
border-style: dotted !important;
}
.drop-hover {
border-style: solid !important;
border-color: #f00 !important;
}
| /* Basic styling */
/* Draw the lines */
.jOrgChart .line {
- height : 20px;
- width : 4px;
+ height: 20px;
+ width: 50%;
}
.jOrgChart .down {
- background-color : black;
? --- -
+ background-color: black;
+ width: 2px;
- margin : 0px auto;
? -----
+ margin: 0px auto;
}
.jOrgChart .top {
- border-top : 3px solid black;
? ---------- ^
+ border-top: 2px solid black;
? ^
}
.jOrgChart .left {
- border-right : 2px solid black;
? ---------- ^
+ border-right: 1px solid black;
? ^
}
.jOrgChart .right {
- border-left : 2px solid black;
? ----------- ^
+ border-left: 1px solid black;
? ^
}
/* node cell */
.jOrgChart td {
- text-align : center;
? ------------
+ text-align: center;
- vertical-align : top;
? --------
+ vertical-align: top;
- padding : 0;
+ padding: 0;
+ margin: 0;
+ float: none;
+ border: none;
+ }
+
+ .jOrgChart tr, .jOrgChart table {
+ border: none;
+ }
+
+ .jOrgChart table {
+ border-collapse: separate;
+ border-spacing: 0;
}
/* The node */
.jOrgChart .node {
- background-color : #35363B;
? --- ^^^^^^
+ background-color: #fff;
? ^^^
+ border: 1px solid black;
- display : inline-block;
? ---------------
+ display: inline-block;
- width : 96px;
- height : 60px;
+ width: 96px;
+ height: 60px;
- z-index : 10;
? -----
+ z-index: 10;
- margin : 0 2px;
+ margin: 0 2px;
}
/* jQuery drag 'n drop */
.drag-active {
- border-style : dotted !important;
? ---
+ border-style: dotted !important;
}
.drop-hover {
- border-style : solid !important;
? ---
+ border-style: solid !important;
- border-color : #E05E00 !important;
? ---- ^^^^
+ border-color: #f00 !important;
? ^
} | 52 | 1.019608 | 33 | 19 |
bf22726e1ca4e10cefbd29c6c5bc2ba9abf67c9e | .travis.yml | .travis.yml | language: ruby
rvm:
- 2.1.5
before_script:
- cp config/database.yml.travis config/database.yml
- psql -c 'create database travis_ci_test;' -U postgres
script:
- RAILS_ENV=test bundle exec rake db:migrate --trace
- bundle exec rspec spec
addons:
postgresql: '9.3'
code_climate:
repo_token: 6acb3ae469a533292083b76b2b5a27796f7ee25e9c6cdfbf81e99621047b7977
bundler_args: "--without production"
deploy:
provider: heroku
api_key:
secure: clsiS/+j6MiPznUEMu3Ve9X4lsDj+iAel504Z33pX3pyXhdmulumnWqT3j1N8Z0ix1h+HkSiPfpmxeDnacWaisZkfKhJl4kVXBngCf/d1xykcsCmcSmUldoWzuVVu3+0v0aNrWiEKW7nHqHnnGdBkCR6DxhRsqsWJJFYYWo0qbA=
app: moffittautosales
| language: ruby
rvm:
- 2.2.0
before_script:
- cp config/database.yml.travis config/database.yml
- psql -c 'create database travis_ci_test;' -U postgres
script:
- RAILS_ENV=test bundle exec rake db:migrate --trace
- bundle exec rspec spec
addons:
postgresql: '9.3'
code_climate:
repo_token: 6acb3ae469a533292083b76b2b5a27796f7ee25e9c6cdfbf81e99621047b7977
bundler_args: "--without production"
deploy:
provider: heroku
api_key:
secure: jSC7sHoFa0VVePWhj5HYH3N43xtB60OJ80eZ9XYI4kTdrcFhq3KZWBdrpkDovBtSKJKIKKaMWY7t2DgdKuacV3Kk9Rm8x21VJ0ULkOYw7TuRExqoAvnRC+eA2BWhHYJXTq2Sk79Gu1XRBJ4N74ATiLUh5iEafYyYP6yMNqTWDRw=
app: moffitt
| Change Travis build for latest changes | Change Travis build for latest changes
| YAML | mit | BigGillyStyle/dealer,BigGillyStyle/dealer,BigGillyStyle/dealer | yaml | ## Code Before:
language: ruby
rvm:
- 2.1.5
before_script:
- cp config/database.yml.travis config/database.yml
- psql -c 'create database travis_ci_test;' -U postgres
script:
- RAILS_ENV=test bundle exec rake db:migrate --trace
- bundle exec rspec spec
addons:
postgresql: '9.3'
code_climate:
repo_token: 6acb3ae469a533292083b76b2b5a27796f7ee25e9c6cdfbf81e99621047b7977
bundler_args: "--without production"
deploy:
provider: heroku
api_key:
secure: clsiS/+j6MiPznUEMu3Ve9X4lsDj+iAel504Z33pX3pyXhdmulumnWqT3j1N8Z0ix1h+HkSiPfpmxeDnacWaisZkfKhJl4kVXBngCf/d1xykcsCmcSmUldoWzuVVu3+0v0aNrWiEKW7nHqHnnGdBkCR6DxhRsqsWJJFYYWo0qbA=
app: moffittautosales
## Instruction:
Change Travis build for latest changes
## Code After:
language: ruby
rvm:
- 2.2.0
before_script:
- cp config/database.yml.travis config/database.yml
- psql -c 'create database travis_ci_test;' -U postgres
script:
- RAILS_ENV=test bundle exec rake db:migrate --trace
- bundle exec rspec spec
addons:
postgresql: '9.3'
code_climate:
repo_token: 6acb3ae469a533292083b76b2b5a27796f7ee25e9c6cdfbf81e99621047b7977
bundler_args: "--without production"
deploy:
provider: heroku
api_key:
secure: jSC7sHoFa0VVePWhj5HYH3N43xtB60OJ80eZ9XYI4kTdrcFhq3KZWBdrpkDovBtSKJKIKKaMWY7t2DgdKuacV3Kk9Rm8x21VJ0ULkOYw7TuRExqoAvnRC+eA2BWhHYJXTq2Sk79Gu1XRBJ4N74ATiLUh5iEafYyYP6yMNqTWDRw=
app: moffitt
| language: ruby
rvm:
- - 2.1.5
+ - 2.2.0
before_script:
- cp config/database.yml.travis config/database.yml
- psql -c 'create database travis_ci_test;' -U postgres
script:
- RAILS_ENV=test bundle exec rake db:migrate --trace
- bundle exec rspec spec
addons:
postgresql: '9.3'
code_climate:
repo_token: 6acb3ae469a533292083b76b2b5a27796f7ee25e9c6cdfbf81e99621047b7977
bundler_args: "--without production"
deploy:
provider: heroku
api_key:
- secure: clsiS/+j6MiPznUEMu3Ve9X4lsDj+iAel504Z33pX3pyXhdmulumnWqT3j1N8Z0ix1h+HkSiPfpmxeDnacWaisZkfKhJl4kVXBngCf/d1xykcsCmcSmUldoWzuVVu3+0v0aNrWiEKW7nHqHnnGdBkCR6DxhRsqsWJJFYYWo0qbA=
+ secure: jSC7sHoFa0VVePWhj5HYH3N43xtB60OJ80eZ9XYI4kTdrcFhq3KZWBdrpkDovBtSKJKIKKaMWY7t2DgdKuacV3Kk9Rm8x21VJ0ULkOYw7TuRExqoAvnRC+eA2BWhHYJXTq2Sk79Gu1XRBJ4N74ATiLUh5iEafYyYP6yMNqTWDRw=
- app: moffittautosales
? ---------
+ app: moffitt | 6 | 0.315789 | 3 | 3 |
240ae629ba54d79d9306227fa9a88e8bc93324ea | tests/extractor_test.py | tests/extractor_test.py | import os
import shutil
from nose.tools import *
import beastling.beastxml
import beastling.configuration
import beastling.extractor
def test_extractor():
config = beastling.configuration.Configuration(configfile="tests/configs/embed_data.conf")
config.process()
xml = beastling.beastxml.BeastXml(config)
os.makedirs("testing_tmp_dir")
os.chdir("testing_tmp_dir")
xml.write_file("beastling.xml")
beastling.extractor.extract("beastling.xml")
os.chdir("..")
shutil.rmtree("testing_tmp_dir")
assert not os.path.exists("testing_tmp_dir")
| import os
import shutil
from nose.tools import *
import beastling.beastxml
import beastling.configuration
import beastling.extractor
_test_dir = os.path.dirname(__file__)
def test_extractor():
config = beastling.configuration.Configuration(configfile="tests/configs/embed_data.conf")
config.process()
xml = beastling.beastxml.BeastXml(config)
os.makedirs("testing_tmp_dir")
os.chdir("testing_tmp_dir")
xml.write_file("beastling.xml")
beastling.extractor.extract("beastling.xml")
def teardown():
os.chdir(os.path.join(_test_dir, ".."))
shutil.rmtree("testing_tmp_dir")
| Clean up afterwards, even if test fails. | Clean up afterwards, even if test fails.
| Python | bsd-2-clause | lmaurits/BEASTling | python | ## Code Before:
import os
import shutil
from nose.tools import *
import beastling.beastxml
import beastling.configuration
import beastling.extractor
def test_extractor():
config = beastling.configuration.Configuration(configfile="tests/configs/embed_data.conf")
config.process()
xml = beastling.beastxml.BeastXml(config)
os.makedirs("testing_tmp_dir")
os.chdir("testing_tmp_dir")
xml.write_file("beastling.xml")
beastling.extractor.extract("beastling.xml")
os.chdir("..")
shutil.rmtree("testing_tmp_dir")
assert not os.path.exists("testing_tmp_dir")
## Instruction:
Clean up afterwards, even if test fails.
## Code After:
import os
import shutil
from nose.tools import *
import beastling.beastxml
import beastling.configuration
import beastling.extractor
_test_dir = os.path.dirname(__file__)
def test_extractor():
config = beastling.configuration.Configuration(configfile="tests/configs/embed_data.conf")
config.process()
xml = beastling.beastxml.BeastXml(config)
os.makedirs("testing_tmp_dir")
os.chdir("testing_tmp_dir")
xml.write_file("beastling.xml")
beastling.extractor.extract("beastling.xml")
def teardown():
os.chdir(os.path.join(_test_dir, ".."))
shutil.rmtree("testing_tmp_dir")
| import os
import shutil
from nose.tools import *
import beastling.beastxml
import beastling.configuration
import beastling.extractor
+ _test_dir = os.path.dirname(__file__)
+
def test_extractor():
config = beastling.configuration.Configuration(configfile="tests/configs/embed_data.conf")
config.process()
xml = beastling.beastxml.BeastXml(config)
os.makedirs("testing_tmp_dir")
os.chdir("testing_tmp_dir")
xml.write_file("beastling.xml")
beastling.extractor.extract("beastling.xml")
- os.chdir("..")
+
+ def teardown():
+ os.chdir(os.path.join(_test_dir, ".."))
shutil.rmtree("testing_tmp_dir")
- assert not os.path.exists("testing_tmp_dir") | 7 | 0.35 | 5 | 2 |
30089eae721daa993500292f9bcee3ac6bf90e2c | app/db/impl/schema/PageSchema.scala | app/db/impl/schema/PageSchema.scala | package db.impl.schema
import scala.concurrent.{ExecutionContext, Future}
import db.impl.OrePostgresDriver.api._
import db.{ModelSchema, ModelService}
import models.project.Page
import cats.data.OptionT
/**
* Page related queries.
*/
class PageSchema(override val service: ModelService)
extends ModelSchema[Page](service, classOf[Page], TableQuery[PageTable]) {
override def like(page: Page)(implicit ec: ExecutionContext): OptionT[Future, Page] =
this.service.find[Page](
this.modelClass,
p =>
p.projectId === page.projectId && p.name.toLowerCase === page.name.toLowerCase
&& page.parentId.isDefined && page.parentId.fold(true: Rep[Boolean])(p.parentId.get === _)
)
}
| package db.impl.schema
import scala.concurrent.{ExecutionContext, Future}
import db.impl.OrePostgresDriver.api._
import db.{ModelSchema, ModelService}
import models.project.Page
import cats.data.OptionT
/**
* Page related queries.
*/
class PageSchema(override val service: ModelService)
extends ModelSchema[Page](service, classOf[Page], TableQuery[PageTable]) {
override def like(page: Page)(implicit ec: ExecutionContext): OptionT[Future, Page] =
this.service.find[Page](
this.modelClass,
p =>
p.projectId === page.projectId && p.name.toLowerCase === page.name.toLowerCase && page.parentId.fold(
true: Rep[Boolean]
)(p.parentId.get === _)
)
}
| Fix like method to find pages correctly | Fix like method to find pages correctly
| Scala | mit | SpongePowered/Ore,SpongePowered/Ore,SpongePowered/Ore,SpongePowered/Ore,SpongePowered/Ore | scala | ## Code Before:
package db.impl.schema
import scala.concurrent.{ExecutionContext, Future}
import db.impl.OrePostgresDriver.api._
import db.{ModelSchema, ModelService}
import models.project.Page
import cats.data.OptionT
/**
* Page related queries.
*/
class PageSchema(override val service: ModelService)
extends ModelSchema[Page](service, classOf[Page], TableQuery[PageTable]) {
override def like(page: Page)(implicit ec: ExecutionContext): OptionT[Future, Page] =
this.service.find[Page](
this.modelClass,
p =>
p.projectId === page.projectId && p.name.toLowerCase === page.name.toLowerCase
&& page.parentId.isDefined && page.parentId.fold(true: Rep[Boolean])(p.parentId.get === _)
)
}
## Instruction:
Fix like method to find pages correctly
## Code After:
package db.impl.schema
import scala.concurrent.{ExecutionContext, Future}
import db.impl.OrePostgresDriver.api._
import db.{ModelSchema, ModelService}
import models.project.Page
import cats.data.OptionT
/**
* Page related queries.
*/
class PageSchema(override val service: ModelService)
extends ModelSchema[Page](service, classOf[Page], TableQuery[PageTable]) {
override def like(page: Page)(implicit ec: ExecutionContext): OptionT[Future, Page] =
this.service.find[Page](
this.modelClass,
p =>
p.projectId === page.projectId && p.name.toLowerCase === page.name.toLowerCase && page.parentId.fold(
true: Rep[Boolean]
)(p.parentId.get === _)
)
}
| package db.impl.schema
import scala.concurrent.{ExecutionContext, Future}
import db.impl.OrePostgresDriver.api._
import db.{ModelSchema, ModelService}
import models.project.Page
import cats.data.OptionT
/**
* Page related queries.
*/
class PageSchema(override val service: ModelService)
extends ModelSchema[Page](service, classOf[Page], TableQuery[PageTable]) {
override def like(page: Page)(implicit ec: ExecutionContext): OptionT[Future, Page] =
this.service.find[Page](
this.modelClass,
p =>
- p.projectId === page.projectId && p.name.toLowerCase === page.name.toLowerCase
+ p.projectId === page.projectId && p.name.toLowerCase === page.name.toLowerCase && page.parentId.fold(
? +++++++++++++++++++++++
- && page.parentId.isDefined && page.parentId.fold(true: Rep[Boolean])(p.parentId.get === _)
+ true: Rep[Boolean]
+ )(p.parentId.get === _)
)
} | 5 | 0.2 | 3 | 2 |
20b8347a5d22579c345716c54add88aee266bf2e | src/Contracts/Builders/Builder.php | src/Contracts/Builders/Builder.php | <?php namespace Aedart\Scaffold\Contracts\Builders;
/**
* Builder
*
* A scaffold builder is responsible for creating a
* specified directory structure, copy files into
* the project folder and generate files based on
* available templates.
*
* @author Alin Eugen Deac <aedart@gmail.com>
* @package Aedart\Scaffold\Contracts\Builders
*/
interface Builder {
} | <?php namespace Aedart\Scaffold\Contracts\Builders;
/**
* Builder
*
* A scaffold builder is responsible for creating a
* specified directory structure, copy files into
* the project folder and generate files based on
* available templates.
*
* @author Alin Eugen Deac <aedart@gmail.com>
* @package Aedart\Scaffold\Contracts\Builders
*/
interface Builder {
public function createDirectories();
public function copyFiles();
public function generateFiles();
} | Add core methods for the builder | Add core methods for the builder
Create directories, copy files and generate files are the main
responsibilities for a Scaffold builder
| PHP | bsd-3-clause | aedart/scaffold,aedart/scaffold | php | ## Code Before:
<?php namespace Aedart\Scaffold\Contracts\Builders;
/**
* Builder
*
* A scaffold builder is responsible for creating a
* specified directory structure, copy files into
* the project folder and generate files based on
* available templates.
*
* @author Alin Eugen Deac <aedart@gmail.com>
* @package Aedart\Scaffold\Contracts\Builders
*/
interface Builder {
}
## Instruction:
Add core methods for the builder
Create directories, copy files and generate files are the main
responsibilities for a Scaffold builder
## Code After:
<?php namespace Aedart\Scaffold\Contracts\Builders;
/**
* Builder
*
* A scaffold builder is responsible for creating a
* specified directory structure, copy files into
* the project folder and generate files based on
* available templates.
*
* @author Alin Eugen Deac <aedart@gmail.com>
* @package Aedart\Scaffold\Contracts\Builders
*/
interface Builder {
public function createDirectories();
public function copyFiles();
public function generateFiles();
} | <?php namespace Aedart\Scaffold\Contracts\Builders;
/**
* Builder
*
* A scaffold builder is responsible for creating a
* specified directory structure, copy files into
* the project folder and generate files based on
* available templates.
*
* @author Alin Eugen Deac <aedart@gmail.com>
* @package Aedart\Scaffold\Contracts\Builders
*/
interface Builder {
+ public function createDirectories();
+ public function copyFiles();
+ public function generateFiles();
+
} | 4 | 0.25 | 4 | 0 |
679057d3bed60b320dd13619c40008990435c2fa | .travis.yml | .travis.yml | language: python
matrix:
include:
- python: "2.7"
- python: "pypy"
env: PYPY_VERSION="4.0.1"
cache:
directories:
- $HOME/.cache/pip
before_install:
# If necessary, set up an appropriate version of pypy.
- if [ ! -z "$PYPY_VERSION" ]; then source utils/setup-pypy-travis.sh; fi
- if [ ! -z "$PYPY_VERSION" ]; then python --version 2>&1 | fgrep "PyPy $PYPY_VERSION"; fi
install:
- pip install 'pip>=7.1.2'
- pip install coveralls
- pip install -r requirements-dev.txt
- pip install -e .
script:
- flake8 sideloader
- py.test --cov=sideloader --cov-report=term
after_success:
- coveralls
| language: python
matrix:
include:
- python: "2.7"
# Disable coverage tests for pypy as they'll always be the same as CPython
- python: "pypy"
env: PYPY_VERSION="4.0.1" NO_COVERAGE=1
cache:
directories:
- $HOME/.cache/pip
before_install:
# If necessary, set up an appropriate version of pypy.
- if [ ! -z "$PYPY_VERSION" ]; then source utils/setup-pypy-travis.sh; fi
- if [ ! -z "$PYPY_VERSION" ]; then python --version 2>&1 | fgrep "PyPy $PYPY_VERSION"; fi
install:
- pip install 'pip>=7.1.2'
- pip install coveralls
- pip install -r requirements-dev.txt
- pip install -e .
script:
- flake8 sideloader
- if [ -z "$NO_COVERAGE" ]; then COVERAGE_OPTS="--cov=sideloader --cov-report=term"; else COVERAGE_OPTS=""; fi
- py.test $COVERAGE_OPTS sideloader
after_success:
- if [ -z "$NO_COVERAGE" ]; then coveralls; fi
| Disable coverage tests for pypy | Travis: Disable coverage tests for pypy
| YAML | mit | praekeltfoundation/sideloader.build,praekeltfoundation/sideloader.build | yaml | ## Code Before:
language: python
matrix:
include:
- python: "2.7"
- python: "pypy"
env: PYPY_VERSION="4.0.1"
cache:
directories:
- $HOME/.cache/pip
before_install:
# If necessary, set up an appropriate version of pypy.
- if [ ! -z "$PYPY_VERSION" ]; then source utils/setup-pypy-travis.sh; fi
- if [ ! -z "$PYPY_VERSION" ]; then python --version 2>&1 | fgrep "PyPy $PYPY_VERSION"; fi
install:
- pip install 'pip>=7.1.2'
- pip install coveralls
- pip install -r requirements-dev.txt
- pip install -e .
script:
- flake8 sideloader
- py.test --cov=sideloader --cov-report=term
after_success:
- coveralls
## Instruction:
Travis: Disable coverage tests for pypy
## Code After:
language: python
matrix:
include:
- python: "2.7"
# Disable coverage tests for pypy as they'll always be the same as CPython
- python: "pypy"
env: PYPY_VERSION="4.0.1" NO_COVERAGE=1
cache:
directories:
- $HOME/.cache/pip
before_install:
# If necessary, set up an appropriate version of pypy.
- if [ ! -z "$PYPY_VERSION" ]; then source utils/setup-pypy-travis.sh; fi
- if [ ! -z "$PYPY_VERSION" ]; then python --version 2>&1 | fgrep "PyPy $PYPY_VERSION"; fi
install:
- pip install 'pip>=7.1.2'
- pip install coveralls
- pip install -r requirements-dev.txt
- pip install -e .
script:
- flake8 sideloader
- if [ -z "$NO_COVERAGE" ]; then COVERAGE_OPTS="--cov=sideloader --cov-report=term"; else COVERAGE_OPTS=""; fi
- py.test $COVERAGE_OPTS sideloader
after_success:
- if [ -z "$NO_COVERAGE" ]; then coveralls; fi
| language: python
matrix:
include:
- python: "2.7"
+ # Disable coverage tests for pypy as they'll always be the same as CPython
- python: "pypy"
- env: PYPY_VERSION="4.0.1"
+ env: PYPY_VERSION="4.0.1" NO_COVERAGE=1
? ++++++++++++++
cache:
directories:
- $HOME/.cache/pip
before_install:
# If necessary, set up an appropriate version of pypy.
- if [ ! -z "$PYPY_VERSION" ]; then source utils/setup-pypy-travis.sh; fi
- if [ ! -z "$PYPY_VERSION" ]; then python --version 2>&1 | fgrep "PyPy $PYPY_VERSION"; fi
install:
- pip install 'pip>=7.1.2'
- pip install coveralls
- pip install -r requirements-dev.txt
- pip install -e .
script:
- flake8 sideloader
- - py.test --cov=sideloader --cov-report=term
+ - if [ -z "$NO_COVERAGE" ]; then COVERAGE_OPTS="--cov=sideloader --cov-report=term"; else COVERAGE_OPTS=""; fi
+ - py.test $COVERAGE_OPTS sideloader
after_success:
- - coveralls
+ - if [ -z "$NO_COVERAGE" ]; then coveralls; fi | 8 | 0.275862 | 5 | 3 |
35fb4dee98e2516331d0e6ab50f3d9612371b88d | README.md | README.md | [](https://travis-ci.org/artyomtrityak/tippyjs)
Tippy.js is a lightweight, vanilla JS tooltip library powered by Popper.js.
View the documentation and demo here: https://atomiks.github.io/tippyjs/
## Installation
See releases: https://github.com/atomiks/tippyjs/releases
It's also available on npm:
```
npm install --save tippy.js
```
| [](https://travis-ci.org/atomiks/tippyjs)
Tippy.js is a lightweight, vanilla JS tooltip library powered by Popper.js.
View the documentation and demo here: https://atomiks.github.io/tippyjs/
## Installation
See releases: https://github.com/atomiks/tippyjs/releases
It's also available on npm:
```
npm install --save tippy.js
```
| Change TravisCI link to atomiks | Change TravisCI link to atomiks
| Markdown | mit | atomiks/tippyjs,atomiks/tippyjs,atomiks/tippyjs,atomiks/tippyjs | markdown | ## Code Before:
[](https://travis-ci.org/artyomtrityak/tippyjs)
Tippy.js is a lightweight, vanilla JS tooltip library powered by Popper.js.
View the documentation and demo here: https://atomiks.github.io/tippyjs/
## Installation
See releases: https://github.com/atomiks/tippyjs/releases
It's also available on npm:
```
npm install --save tippy.js
```
## Instruction:
Change TravisCI link to atomiks
## Code After:
[](https://travis-ci.org/atomiks/tippyjs)
Tippy.js is a lightweight, vanilla JS tooltip library powered by Popper.js.
View the documentation and demo here: https://atomiks.github.io/tippyjs/
## Installation
See releases: https://github.com/atomiks/tippyjs/releases
It's also available on npm:
```
npm install --save tippy.js
```
| - [](https://travis-ci.org/artyomtrityak/tippyjs)
? - - -- --- - - -- ---
+ [](https://travis-ci.org/atomiks/tippyjs)
? + +
Tippy.js is a lightweight, vanilla JS tooltip library powered by Popper.js.
View the documentation and demo here: https://atomiks.github.io/tippyjs/
## Installation
See releases: https://github.com/atomiks/tippyjs/releases
It's also available on npm:
```
npm install --save tippy.js
```
| 2 | 0.125 | 1 | 1 |
d0578030e8fce16edc11734dc2a0f9a64b21516e | src/components/type/type.mapper.ts | src/components/type/type.mapper.ts | import { Type } from './type.model';
import { ItemTemplate } from '@core/game_master/gameMaster';
import { Util } from '@util';
import APP_SETTINGS from '@settings/app';
export class TypeMapper {
public static Map(rawType: ItemTemplate): Type {
let type: Type = new Type();
type.id = rawType.templateId;
type.name = Util.SnakeCase2HumanReadable(rawType.templateId.replace('POKEMON_TYPE_', ''));
type.damage = APP_SETTINGS.POKEMON_TYPES.map((pokemonType, index) => { return {
id: pokemonType.id,
attackScalar: rawType.typeEffective.attackScalar[pokemonType.attackScalarIndex]
}});
return type;
}
}
| import { Type } from './type.model';
import { ItemTemplate } from '@core/game_master/gameMaster';
import { Util } from '@util';
import APP_SETTINGS from '@settings/app';
export class TypeMapper {
public static Map(rawType: ItemTemplate): Type {
let type: Type = new Type();
type.id = rawType.templateId;
type.name = Util.SnakeCase2HumanReadable(rawType.templateId.replace('POKEMON_TYPE_', ''));
type.damage = APP_SETTINGS.POKEMON_TYPES.map((pokemonType, index) => ({
id: pokemonType.id,
attackScalar: rawType.typeEffective.attackScalar[pokemonType.attackScalarIndex]
}));
return type;
}
}
| Add type.json - Code style changes | Add type.json - Code style changes
| TypeScript | mit | BrunnerLivio/pokemongo-json-pokedex,vfcp/pokemongo-json-pokedex,BrunnerLivio/pokemongo-data-normalizer,BrunnerLivio/pokemongo-json-pokedex,BrunnerLivio/pokemongo-data-normalizer,vfcp/pokemongo-json-pokedex | typescript | ## Code Before:
import { Type } from './type.model';
import { ItemTemplate } from '@core/game_master/gameMaster';
import { Util } from '@util';
import APP_SETTINGS from '@settings/app';
export class TypeMapper {
public static Map(rawType: ItemTemplate): Type {
let type: Type = new Type();
type.id = rawType.templateId;
type.name = Util.SnakeCase2HumanReadable(rawType.templateId.replace('POKEMON_TYPE_', ''));
type.damage = APP_SETTINGS.POKEMON_TYPES.map((pokemonType, index) => { return {
id: pokemonType.id,
attackScalar: rawType.typeEffective.attackScalar[pokemonType.attackScalarIndex]
}});
return type;
}
}
## Instruction:
Add type.json - Code style changes
## Code After:
import { Type } from './type.model';
import { ItemTemplate } from '@core/game_master/gameMaster';
import { Util } from '@util';
import APP_SETTINGS from '@settings/app';
export class TypeMapper {
public static Map(rawType: ItemTemplate): Type {
let type: Type = new Type();
type.id = rawType.templateId;
type.name = Util.SnakeCase2HumanReadable(rawType.templateId.replace('POKEMON_TYPE_', ''));
type.damage = APP_SETTINGS.POKEMON_TYPES.map((pokemonType, index) => ({
id: pokemonType.id,
attackScalar: rawType.typeEffective.attackScalar[pokemonType.attackScalarIndex]
}));
return type;
}
}
| import { Type } from './type.model';
import { ItemTemplate } from '@core/game_master/gameMaster';
import { Util } from '@util';
import APP_SETTINGS from '@settings/app';
export class TypeMapper {
public static Map(rawType: ItemTemplate): Type {
let type: Type = new Type();
type.id = rawType.templateId;
type.name = Util.SnakeCase2HumanReadable(rawType.templateId.replace('POKEMON_TYPE_', ''));
- type.damage = APP_SETTINGS.POKEMON_TYPES.map((pokemonType, index) => { return {
? ---------
+ type.damage = APP_SETTINGS.POKEMON_TYPES.map((pokemonType, index) => ({
? +
id: pokemonType.id,
attackScalar: rawType.typeEffective.attackScalar[pokemonType.attackScalarIndex]
- }});
? ^
+ }));
? ^
return type;
}
} | 4 | 0.2 | 2 | 2 |
458f1e269646f432ef52774230114a4b05351211 | controllers/default.py | controllers/default.py | import os
def index():
def GET():
return locals()
@request.restful()
def api():
response.view = 'generic.json'
def GET(resource,resource_id):
if not resource=='study': raise HTTP(400)
# return the correct nexson of study_id
return _get_nexson(resource_id)
def POST(resource,resource_id):
if not resource=='study': raise HTTP(400)
# overwrite the nexson of study_id with the POSTed data
# 1) verify that it is valid json
# 2) Update local treenexus git submodule at ./treenexus
# 3) See if the hash of the current value of the file matches the hash of the POSTed data. If so, do nothing and return successfully.
# 4) If not, overwrite the correct nexson file on disk
# 5) Make a git commit with the updated nexson (add as much automated metadata to the commit message as possible)
# 6) return successfully
return dict()
return locals()
def _get_nexson(study_id):
this_dir = os.path.dirname(os.path.abspath(__file__))
# the internal file structure will change soon to study/study_id/study_id-N.json, where N=0,1,2,3...
try:
filename = this_dir + "/../treenexus/study/0/" + study_id + ".json"
nexson_file = open(filename,'r')
except IOError:
return '{}'
return nexson_file.readlines()
| import os
def index():
def GET():
return locals()
@request.restful()
def api():
response.view = 'generic.json'
def GET(resource,resource_id):
if not resource=='study': raise HTTP(400)
# return the correct nexson of study_id
return _get_nexson(resource_id)
def POST(resource,resource_id):
if not resource=='study': raise HTTP(400)
# overwrite the nexson of study_id with the POSTed data
# 1) verify that it is valid json
# 2) Update local treenexus git submodule at ./treenexus
# 3) See if the hash of the current value of the file matches the hash of the POSTed data. If so, do nothing and return successfully.
# 4) If not, overwrite the correct nexson file on disk
# 5) Make a git commit with the updated nexson (add as much automated metadata to the commit message as possible)
# 6) return successfully
return dict()
return locals()
def _get_nexson(study_id):
this_dir = os.path.dirname(os.path.abspath(__file__))
try:
filename = this_dir + "/../treenexus/study/" + study_id + "/" + study_id + ".json"
nexson_file = open(filename,'r')
except IOError:
return '{}'
return nexson_file.readlines()
| Use the new location of study NexSON | Use the new location of study NexSON
Each study now has a distinct directory. Currently we only plan to store
a single JSON file in each directory, until one becomes larger than 50MB.
Additionally, this allows various metadata/artifacts about a study to live
near the actually study data.
| Python | bsd-2-clause | leto/new_opentree_api,leto/new_opentree_api | python | ## Code Before:
import os
def index():
def GET():
return locals()
@request.restful()
def api():
response.view = 'generic.json'
def GET(resource,resource_id):
if not resource=='study': raise HTTP(400)
# return the correct nexson of study_id
return _get_nexson(resource_id)
def POST(resource,resource_id):
if not resource=='study': raise HTTP(400)
# overwrite the nexson of study_id with the POSTed data
# 1) verify that it is valid json
# 2) Update local treenexus git submodule at ./treenexus
# 3) See if the hash of the current value of the file matches the hash of the POSTed data. If so, do nothing and return successfully.
# 4) If not, overwrite the correct nexson file on disk
# 5) Make a git commit with the updated nexson (add as much automated metadata to the commit message as possible)
# 6) return successfully
return dict()
return locals()
def _get_nexson(study_id):
this_dir = os.path.dirname(os.path.abspath(__file__))
# the internal file structure will change soon to study/study_id/study_id-N.json, where N=0,1,2,3...
try:
filename = this_dir + "/../treenexus/study/0/" + study_id + ".json"
nexson_file = open(filename,'r')
except IOError:
return '{}'
return nexson_file.readlines()
## Instruction:
Use the new location of study NexSON
Each study now has a distinct directory. Currently we only plan to store
a single JSON file in each directory, until one becomes larger than 50MB.
Additionally, this allows various metadata/artifacts about a study to live
near the actually study data.
## Code After:
import os
def index():
def GET():
return locals()
@request.restful()
def api():
response.view = 'generic.json'
def GET(resource,resource_id):
if not resource=='study': raise HTTP(400)
# return the correct nexson of study_id
return _get_nexson(resource_id)
def POST(resource,resource_id):
if not resource=='study': raise HTTP(400)
# overwrite the nexson of study_id with the POSTed data
# 1) verify that it is valid json
# 2) Update local treenexus git submodule at ./treenexus
# 3) See if the hash of the current value of the file matches the hash of the POSTed data. If so, do nothing and return successfully.
# 4) If not, overwrite the correct nexson file on disk
# 5) Make a git commit with the updated nexson (add as much automated metadata to the commit message as possible)
# 6) return successfully
return dict()
return locals()
def _get_nexson(study_id):
this_dir = os.path.dirname(os.path.abspath(__file__))
try:
filename = this_dir + "/../treenexus/study/" + study_id + "/" + study_id + ".json"
nexson_file = open(filename,'r')
except IOError:
return '{}'
return nexson_file.readlines()
| import os
def index():
def GET():
return locals()
@request.restful()
def api():
response.view = 'generic.json'
def GET(resource,resource_id):
if not resource=='study': raise HTTP(400)
# return the correct nexson of study_id
return _get_nexson(resource_id)
def POST(resource,resource_id):
if not resource=='study': raise HTTP(400)
# overwrite the nexson of study_id with the POSTed data
# 1) verify that it is valid json
# 2) Update local treenexus git submodule at ./treenexus
# 3) See if the hash of the current value of the file matches the hash of the POSTed data. If so, do nothing and return successfully.
# 4) If not, overwrite the correct nexson file on disk
# 5) Make a git commit with the updated nexson (add as much automated metadata to the commit message as possible)
# 6) return successfully
return dict()
return locals()
def _get_nexson(study_id):
this_dir = os.path.dirname(os.path.abspath(__file__))
- # the internal file structure will change soon to study/study_id/study_id-N.json, where N=0,1,2,3...
try:
- filename = this_dir + "/../treenexus/study/0/" + study_id + ".json"
? ^
+ filename = this_dir + "/../treenexus/study/" + study_id + "/" + study_id + ".json"
? ^^^^^^^^^^^^^^^^
nexson_file = open(filename,'r')
except IOError:
return '{}'
return nexson_file.readlines() | 3 | 0.078947 | 1 | 2 |
02360c01f042a77c22a774b70e76b39dce357d1e | homedisplay/info_weather/static/js/weather_door.js | homedisplay/info_weather/static/js/weather_door.js | var RefreshWeather = function (options) {
options = options || {};
options.elem = options.elem || "#weather-general";
options.update_interval = options.update_interval || 15 * 60 * 1000;
var elem = $(options.elem),
update_interval;
function setWeatherInfo (icon, temperature) {
elem.html("<img src='/homecontroller/static/images/" + icon + ".png'><br> " + temperature + "°C");
}
function resetWeatherInfo() {
elem.html("<i class='fa fa-question-circle'></i>");
}
function update() {
$.get("/homecontroller/weather/get_json?"+(new Date()).getTime(), function (data) {
resetWeatherInfo();
setWeatherInfo(data.current.icon, data.current.feels_like);
});
}
function startInterval() {
update();
update_interval = setInterval(update, options.update_interval);
}
function stopInterval() {
update_interval = clearInterval(update_interval);
}
this.update = update;
this.startInterval = startInterval;
this.stopInterval = stopInterval;
};
var refresh_weather;
$(document).ready(function () {
refresh_weather = new RefreshWeather({"elem": "#weather-general"});
refresh_weather.startInterval();
});
| var RefreshWeather = function (options) {
options = options || {};
options.elem = options.elem || "#weather-general";
options.update_interval = options.update_interval || 15 * 60 * 1000;
var elem = $(options.elem),
update_interval;
function setWeatherInfo (icon, temperature) {
elem.html("<img src='/homecontroller/static/images/" + icon + ".png'><br> " + temperature + "°C");
}
function resetWeatherInfo() {
elem.html("<i class='fa fa-question-circle'></i>");
}
function update() {
$.get("/homecontroller/weather/get_json?"+(new Date()).getTime(), function (data) {
resetWeatherInfo();
if (data && data.current) {
setWeatherInfo(data.current.icon, data.current.feels_like);
}
});
}
function startInterval() {
update();
update_interval = setInterval(update, options.update_interval);
}
function stopInterval() {
update_interval = clearInterval(update_interval);
}
this.update = update;
this.startInterval = startInterval;
this.stopInterval = stopInterval;
};
var refresh_weather;
$(document).ready(function () {
refresh_weather = new RefreshWeather({"elem": "#weather-general"});
refresh_weather.startInterval();
});
| Check weather data validity on refresh | Check weather data validity on refresh
Related to #76
| JavaScript | bsd-3-clause | ojarva/home-info-display,ojarva/home-info-display,ojarva/home-info-display,ojarva/home-info-display | javascript | ## Code Before:
var RefreshWeather = function (options) {
options = options || {};
options.elem = options.elem || "#weather-general";
options.update_interval = options.update_interval || 15 * 60 * 1000;
var elem = $(options.elem),
update_interval;
function setWeatherInfo (icon, temperature) {
elem.html("<img src='/homecontroller/static/images/" + icon + ".png'><br> " + temperature + "°C");
}
function resetWeatherInfo() {
elem.html("<i class='fa fa-question-circle'></i>");
}
function update() {
$.get("/homecontroller/weather/get_json?"+(new Date()).getTime(), function (data) {
resetWeatherInfo();
setWeatherInfo(data.current.icon, data.current.feels_like);
});
}
function startInterval() {
update();
update_interval = setInterval(update, options.update_interval);
}
function stopInterval() {
update_interval = clearInterval(update_interval);
}
this.update = update;
this.startInterval = startInterval;
this.stopInterval = stopInterval;
};
var refresh_weather;
$(document).ready(function () {
refresh_weather = new RefreshWeather({"elem": "#weather-general"});
refresh_weather.startInterval();
});
## Instruction:
Check weather data validity on refresh
Related to #76
## Code After:
var RefreshWeather = function (options) {
options = options || {};
options.elem = options.elem || "#weather-general";
options.update_interval = options.update_interval || 15 * 60 * 1000;
var elem = $(options.elem),
update_interval;
function setWeatherInfo (icon, temperature) {
elem.html("<img src='/homecontroller/static/images/" + icon + ".png'><br> " + temperature + "°C");
}
function resetWeatherInfo() {
elem.html("<i class='fa fa-question-circle'></i>");
}
function update() {
$.get("/homecontroller/weather/get_json?"+(new Date()).getTime(), function (data) {
resetWeatherInfo();
if (data && data.current) {
setWeatherInfo(data.current.icon, data.current.feels_like);
}
});
}
function startInterval() {
update();
update_interval = setInterval(update, options.update_interval);
}
function stopInterval() {
update_interval = clearInterval(update_interval);
}
this.update = update;
this.startInterval = startInterval;
this.stopInterval = stopInterval;
};
var refresh_weather;
$(document).ready(function () {
refresh_weather = new RefreshWeather({"elem": "#weather-general"});
refresh_weather.startInterval();
});
| var RefreshWeather = function (options) {
options = options || {};
options.elem = options.elem || "#weather-general";
options.update_interval = options.update_interval || 15 * 60 * 1000;
var elem = $(options.elem),
update_interval;
function setWeatherInfo (icon, temperature) {
elem.html("<img src='/homecontroller/static/images/" + icon + ".png'><br> " + temperature + "°C");
}
function resetWeatherInfo() {
elem.html("<i class='fa fa-question-circle'></i>");
}
function update() {
$.get("/homecontroller/weather/get_json?"+(new Date()).getTime(), function (data) {
resetWeatherInfo();
+ if (data && data.current) {
- setWeatherInfo(data.current.icon, data.current.feels_like);
+ setWeatherInfo(data.current.icon, data.current.feels_like);
? ++
+ }
});
}
function startInterval() {
update();
update_interval = setInterval(update, options.update_interval);
}
function stopInterval() {
update_interval = clearInterval(update_interval);
}
this.update = update;
this.startInterval = startInterval;
this.stopInterval = stopInterval;
};
var refresh_weather;
$(document).ready(function () {
refresh_weather = new RefreshWeather({"elem": "#weather-general"});
refresh_weather.startInterval();
}); | 4 | 0.097561 | 3 | 1 |
073b4ac984082956e72b48157ff1b69842228b89 | src/clj/clj_templates/config/main_config.clj | src/clj/clj_templates/config/main_config.clj | (ns clj-templates.config.main-config
(:require [integrant.core :as ig]
[environ.core :refer [env]]))
(def main-config
{:handler/main {:db (ig/ref :db/postgres)}
:server/jetty {:handler (ig/ref :handler/main)
:opts {:port 3000 :join? false}}
:db/postgres {:jdbc-url (env :database-url)
:driver-class-name "org.postgresql.Driver"}
:logger/timbre {:appenders {:println {:stream :auto}}}
:jobs/scheduled-jobs {:hours-between-jobs 1
:db (ig/ref :db/postgres)
:es-client (ig/ref :search/elastic)}
:search/elastic {:hosts ["http://127.0.0.1:9200"]
:default-headers {:content-type "application/json"}}})
| (ns clj-templates.config.main-config
(:require [integrant.core :as ig]
[environ.core :refer [env]]))
(def main-config
{:handler/main {:db (ig/ref :db/postgres)}
:server/jetty {:handler (ig/ref :handler/main)
:opts {:port 3000 :join? false}}
:db/postgres {:jdbc-url (env :database-url)
:driver-class-name "org.postgresql.Driver"}
:logger/timbre {:appenders {:println {:stream :auto}}}
:jobs/scheduled-jobs {:hours-between-jobs 1
:db (ig/ref :db/postgres)
:es-client (ig/ref :search/elastic)}
:search/elastic {:hosts [(env :elastic-url)]
:default-headers {:content-type "application/json"}}})
| Use env for elastic url. | Use env for elastic url.
| Clojure | epl-1.0 | Dexterminator/clj-templates,Dexterminator/clj-templates | clojure | ## Code Before:
(ns clj-templates.config.main-config
(:require [integrant.core :as ig]
[environ.core :refer [env]]))
(def main-config
{:handler/main {:db (ig/ref :db/postgres)}
:server/jetty {:handler (ig/ref :handler/main)
:opts {:port 3000 :join? false}}
:db/postgres {:jdbc-url (env :database-url)
:driver-class-name "org.postgresql.Driver"}
:logger/timbre {:appenders {:println {:stream :auto}}}
:jobs/scheduled-jobs {:hours-between-jobs 1
:db (ig/ref :db/postgres)
:es-client (ig/ref :search/elastic)}
:search/elastic {:hosts ["http://127.0.0.1:9200"]
:default-headers {:content-type "application/json"}}})
## Instruction:
Use env for elastic url.
## Code After:
(ns clj-templates.config.main-config
(:require [integrant.core :as ig]
[environ.core :refer [env]]))
(def main-config
{:handler/main {:db (ig/ref :db/postgres)}
:server/jetty {:handler (ig/ref :handler/main)
:opts {:port 3000 :join? false}}
:db/postgres {:jdbc-url (env :database-url)
:driver-class-name "org.postgresql.Driver"}
:logger/timbre {:appenders {:println {:stream :auto}}}
:jobs/scheduled-jobs {:hours-between-jobs 1
:db (ig/ref :db/postgres)
:es-client (ig/ref :search/elastic)}
:search/elastic {:hosts [(env :elastic-url)]
:default-headers {:content-type "application/json"}}})
| (ns clj-templates.config.main-config
(:require [integrant.core :as ig]
[environ.core :refer [env]]))
(def main-config
{:handler/main {:db (ig/ref :db/postgres)}
:server/jetty {:handler (ig/ref :handler/main)
:opts {:port 3000 :join? false}}
:db/postgres {:jdbc-url (env :database-url)
:driver-class-name "org.postgresql.Driver"}
:logger/timbre {:appenders {:println {:stream :auto}}}
:jobs/scheduled-jobs {:hours-between-jobs 1
:db (ig/ref :db/postgres)
:es-client (ig/ref :search/elastic)}
- :search/elastic {:hosts ["http://127.0.0.1:9200"]
+ :search/elastic {:hosts [(env :elastic-url)]
:default-headers {:content-type "application/json"}}}) | 2 | 0.125 | 1 | 1 |
a16c6a006705edb5428935dcc61dc20c7edf128b | app/controllers/api/v4/games_controller.rb | app/controllers/api/v4/games_controller.rb | class Api::V4::GamesController < Api::V4::ApplicationController
before_action :set_game, only: [:show]
def index
if params[:search].blank?
render status: 400, json: {status: 400, message: 'You must supply a `search` term.'}
return
end
@games = Game.search(params[:search])
render json: @games, each_serializer: Api::V4::GameSerializer
end
def show
render json: @game, serializer: Api::V4::GameSerializer
end
private
def set_game
@game = Game.includes(:categories).find_by(shortname: params[:id]) || Game.includes(:categories).find(params[:id])
rescue ActiveRecord::RecordNotFound
render not_found(:game, params[:id])
end
end
| class Api::V4::GamesController < Api::V4::ApplicationController
before_action :set_game, only: [:show]
def index
if params[:search].blank?
render status: 400, json: {status: 400, message: 'You must supply a `search` term.'}
return
end
@games = Game.search(params[:search]).includes(:categories)
render json: @games, each_serializer: Api::V4::GameSerializer
end
def show
render json: @game, serializer: Api::V4::GameSerializer
end
private
def set_game
@game = Game.includes(:categories).find_by(shortname: params[:id]) || Game.includes(:categories).find(params[:id])
rescue ActiveRecord::RecordNotFound
render not_found(:game, params[:id])
end
end
| Fix n+1 queries on v4 search | Fix n+1 queries on v4 search
| Ruby | agpl-3.0 | BatedUrGonnaDie/splits-io,BatedUrGonnaDie/splits-io,BatedUrGonnaDie/splits-io,BatedUrGonnaDie/splits-io,glacials/splits-io,glacials/splits-io,glacials/splits-io,glacials/splits-io | ruby | ## Code Before:
class Api::V4::GamesController < Api::V4::ApplicationController
before_action :set_game, only: [:show]
def index
if params[:search].blank?
render status: 400, json: {status: 400, message: 'You must supply a `search` term.'}
return
end
@games = Game.search(params[:search])
render json: @games, each_serializer: Api::V4::GameSerializer
end
def show
render json: @game, serializer: Api::V4::GameSerializer
end
private
def set_game
@game = Game.includes(:categories).find_by(shortname: params[:id]) || Game.includes(:categories).find(params[:id])
rescue ActiveRecord::RecordNotFound
render not_found(:game, params[:id])
end
end
## Instruction:
Fix n+1 queries on v4 search
## Code After:
class Api::V4::GamesController < Api::V4::ApplicationController
before_action :set_game, only: [:show]
def index
if params[:search].blank?
render status: 400, json: {status: 400, message: 'You must supply a `search` term.'}
return
end
@games = Game.search(params[:search]).includes(:categories)
render json: @games, each_serializer: Api::V4::GameSerializer
end
def show
render json: @game, serializer: Api::V4::GameSerializer
end
private
def set_game
@game = Game.includes(:categories).find_by(shortname: params[:id]) || Game.includes(:categories).find(params[:id])
rescue ActiveRecord::RecordNotFound
render not_found(:game, params[:id])
end
end
| class Api::V4::GamesController < Api::V4::ApplicationController
before_action :set_game, only: [:show]
def index
if params[:search].blank?
render status: 400, json: {status: 400, message: 'You must supply a `search` term.'}
return
end
- @games = Game.search(params[:search])
+ @games = Game.search(params[:search]).includes(:categories)
? ++++++++++++++++++++++
render json: @games, each_serializer: Api::V4::GameSerializer
end
def show
render json: @game, serializer: Api::V4::GameSerializer
end
private
def set_game
@game = Game.includes(:categories).find_by(shortname: params[:id]) || Game.includes(:categories).find(params[:id])
rescue ActiveRecord::RecordNotFound
render not_found(:game, params[:id])
end
end | 2 | 0.083333 | 1 | 1 |
3f04c611cf9519940292f9f6cd3726213611df04 | app/views/sections/show.html.erb | app/views/sections/show.html.erb | <article class="tariff chapters">
<div class="inner">
<h1><%= @section %></h1>
<ol id="chapters">
<%= render @chapters %>
</ol>
</div>
</article>
| <% content_for :title, "#{@section} | Trade Tariff | GOV.UK" %>
<article class="tariff chapters">
<div class="inner">
<h1><%= @section %></h1>
<ol id="chapters">
<%= render @chapters %>
</ol>
</div>
</article>
| Add a title to the sections page as well | Add a title to the sections page as well
| HTML+ERB | mit | bitzesty/trade-tariff-frontend,bitzesty/trade-tariff-frontend,alphagov/trade-tariff-frontend,alphagov/trade-tariff-frontend,alphagov/trade-tariff-frontend,bitzesty/trade-tariff-frontend,bitzesty/trade-tariff-frontend,alphagov/trade-tariff-frontend | html+erb | ## Code Before:
<article class="tariff chapters">
<div class="inner">
<h1><%= @section %></h1>
<ol id="chapters">
<%= render @chapters %>
</ol>
</div>
</article>
## Instruction:
Add a title to the sections page as well
## Code After:
<% content_for :title, "#{@section} | Trade Tariff | GOV.UK" %>
<article class="tariff chapters">
<div class="inner">
<h1><%= @section %></h1>
<ol id="chapters">
<%= render @chapters %>
</ol>
</div>
</article>
| + <% content_for :title, "#{@section} | Trade Tariff | GOV.UK" %>
+
<article class="tariff chapters">
<div class="inner">
<h1><%= @section %></h1>
<ol id="chapters">
<%= render @chapters %>
</ol>
</div>
</article> | 2 | 0.25 | 2 | 0 |
51f8a378860504bf52a736a9be7ac5ea9443c6a1 | src/assets/scripts/modern/superslide.init.js | src/assets/scripts/modern/superslide.init.js | // JavaScript Document
// Scripts written by __gulp_init__author_name @ __gulp_init__author_company
import SuperSlide from "superslide.js";
import focusTrap from "focus-trap";
// get the elements
const CONTENT = document.getElementById("page-container");
const SLIDER = document.getElementById("mobile-menu");
const TOGGLE = document.querySelector("[data-toggle=mobile-menu]");
const FOCUS_TRAP = focusTrap("#mobile-menu");
// verify that the elements exist
if (CONTENT !== null && SLIDER !== null && TOGGLE !== null) {
// initialize the menu
const MOBILE_MENU = new SuperSlide({
allowContentInteraction: false,
animation: "slideLeft",
closeOnBlur: true,
content: document.getElementById("page-container"),
duration: 0.25,
slideContent: false,
slider: document.getElementById("mobile-menu"),
onOpen: () => {
SLIDER.setAttribute("aria-hidden", false);
FOCUS_TRAP.activate();
},
onClose: () => {
SLIDER.setAttribute("aria-hidden", true);
FOCUS_TRAP.deactivate();
},
});
// open the menu when clicking on the toggle
TOGGLE.addEventListener("click", (e) => {
e.preventDefault();
console.log(MOBILE_MENU.isOpen());
if (!MOBILE_MENU.isOpen()) {
MOBILE_MENU.open();
} else {
MOBILE_MENU.close();
}
});
}
| // JavaScript Document
// Scripts written by __gulp_init__author_name @ __gulp_init__author_company
import SuperSlide from "superslide.js";
// get the elements
const CONTENT = document.getElementById("page-container");
const SLIDER = document.getElementById("mobile-menu");
const TOGGLE = document.querySelector("[data-toggle=mobile-menu]");
// verify that the elements exist
if (CONTENT !== null && SLIDER !== null && TOGGLE !== null) {
// initialize the menu
const MOBILE_MENU = new SuperSlide({
allowContentInteraction: false,
animation: "slideLeft",
closeOnBlur: true,
content: document.getElementById("page-container"),
duration: 0.25,
slideContent: false,
slider: document.getElementById("mobile-menu"),
onOpen: () => {
SLIDER.setAttribute("aria-hidden", false);
},
onClose: () => {
SLIDER.setAttribute("aria-hidden", true);
},
});
// open the menu when clicking on the toggle
TOGGLE.addEventListener("click", (e) => {
e.preventDefault();
console.log(MOBILE_MENU.isOpen());
if (!MOBILE_MENU.isOpen()) {
MOBILE_MENU.open();
} else {
MOBILE_MENU.close();
}
});
}
| Revert "Trap focus to the menu when open" | Revert "Trap focus to the menu when open"
This reverts commit ed195f52702a7eead162d9f10e6e898de0fe9029.
Trapping focus was preventing the menu from being closeable
| JavaScript | mit | revxx14/new-site,JacobDB/new-site,JacobDB/new-site,JacobDB/new-site,revxx14/new-site | javascript | ## Code Before:
// JavaScript Document
// Scripts written by __gulp_init__author_name @ __gulp_init__author_company
import SuperSlide from "superslide.js";
import focusTrap from "focus-trap";
// get the elements
const CONTENT = document.getElementById("page-container");
const SLIDER = document.getElementById("mobile-menu");
const TOGGLE = document.querySelector("[data-toggle=mobile-menu]");
const FOCUS_TRAP = focusTrap("#mobile-menu");
// verify that the elements exist
if (CONTENT !== null && SLIDER !== null && TOGGLE !== null) {
// initialize the menu
const MOBILE_MENU = new SuperSlide({
allowContentInteraction: false,
animation: "slideLeft",
closeOnBlur: true,
content: document.getElementById("page-container"),
duration: 0.25,
slideContent: false,
slider: document.getElementById("mobile-menu"),
onOpen: () => {
SLIDER.setAttribute("aria-hidden", false);
FOCUS_TRAP.activate();
},
onClose: () => {
SLIDER.setAttribute("aria-hidden", true);
FOCUS_TRAP.deactivate();
},
});
// open the menu when clicking on the toggle
TOGGLE.addEventListener("click", (e) => {
e.preventDefault();
console.log(MOBILE_MENU.isOpen());
if (!MOBILE_MENU.isOpen()) {
MOBILE_MENU.open();
} else {
MOBILE_MENU.close();
}
});
}
## Instruction:
Revert "Trap focus to the menu when open"
This reverts commit ed195f52702a7eead162d9f10e6e898de0fe9029.
Trapping focus was preventing the menu from being closeable
## Code After:
// JavaScript Document
// Scripts written by __gulp_init__author_name @ __gulp_init__author_company
import SuperSlide from "superslide.js";
// get the elements
const CONTENT = document.getElementById("page-container");
const SLIDER = document.getElementById("mobile-menu");
const TOGGLE = document.querySelector("[data-toggle=mobile-menu]");
// verify that the elements exist
if (CONTENT !== null && SLIDER !== null && TOGGLE !== null) {
// initialize the menu
const MOBILE_MENU = new SuperSlide({
allowContentInteraction: false,
animation: "slideLeft",
closeOnBlur: true,
content: document.getElementById("page-container"),
duration: 0.25,
slideContent: false,
slider: document.getElementById("mobile-menu"),
onOpen: () => {
SLIDER.setAttribute("aria-hidden", false);
},
onClose: () => {
SLIDER.setAttribute("aria-hidden", true);
},
});
// open the menu when clicking on the toggle
TOGGLE.addEventListener("click", (e) => {
e.preventDefault();
console.log(MOBILE_MENU.isOpen());
if (!MOBILE_MENU.isOpen()) {
MOBILE_MENU.open();
} else {
MOBILE_MENU.close();
}
});
}
| // JavaScript Document
// Scripts written by __gulp_init__author_name @ __gulp_init__author_company
import SuperSlide from "superslide.js";
- import focusTrap from "focus-trap";
// get the elements
const CONTENT = document.getElementById("page-container");
const SLIDER = document.getElementById("mobile-menu");
const TOGGLE = document.querySelector("[data-toggle=mobile-menu]");
- const FOCUS_TRAP = focusTrap("#mobile-menu");
// verify that the elements exist
if (CONTENT !== null && SLIDER !== null && TOGGLE !== null) {
// initialize the menu
const MOBILE_MENU = new SuperSlide({
allowContentInteraction: false,
animation: "slideLeft",
closeOnBlur: true,
content: document.getElementById("page-container"),
duration: 0.25,
slideContent: false,
slider: document.getElementById("mobile-menu"),
onOpen: () => {
SLIDER.setAttribute("aria-hidden", false);
- FOCUS_TRAP.activate();
},
onClose: () => {
SLIDER.setAttribute("aria-hidden", true);
- FOCUS_TRAP.deactivate();
},
});
// open the menu when clicking on the toggle
TOGGLE.addEventListener("click", (e) => {
e.preventDefault();
console.log(MOBILE_MENU.isOpen());
if (!MOBILE_MENU.isOpen()) {
MOBILE_MENU.open();
} else {
MOBILE_MENU.close();
}
});
} | 4 | 0.085106 | 0 | 4 |
fa8277faa5717b385af67e4dfaac8fa6e15ca2d3 | .travis.yml | .travis.yml | language: node_js
services:
- docker
node_js:
- "7"
env:
global:
- CXX=g++-4.9
- CC=gcc-4.9
- DISPLAY=:99.0
before_install:
- sh -e /etc/init.d/xvfb start
install:
- npm install --no-save
script:
- npm run gulp
- npm run integration-test | language: node_js
services:
- docker
node_js:
- '7'
env:
global:
- CXX=g++-4.9
- CC=gcc-4.9
- DISPLAY=:99.0
before_install:
- sh -e /etc/init.d/xvfb start
install:
- npm install --no-save
- npm install -g vsce
script:
- npm run gulp
- npm run integration-test
- vsce package
deploy:
provider: releases
api_key:
secure: mmkCO7tT+EUaKt//ksZFpJhX1ZMAN5P5dtgcIwWa7RTObNxblLndWTXwj5l6GmNm1LWAZ6ShXZ77Dtn/lmfbeldrfhoJ4NPC0pa5t6OijUIzJjp1BvUJpfLw3r5hrbpRVKb7cllKRMAs3PmMs055tr+KkbSGJn7Jp80+V275FfgbcdHYtMwblgXhTByvIFpvJ8oqg8+s9nd1hoXPgrAbAdU1hptvGzflx6tnQrZmbu43DmaYIy9BORBaMoAlVzUYHj0wX/xxCa88r3MxXB7WgVT+v8yNr34n/bkQ1Gv5DONicXIyOX4ANRXr2uHUP5hE3jxJszeBrskNU7mKz5fJuiN/hOOVMeiq9Cof3I+rISb1QHzBtiGrghczz73bep7d/OnZXxapjVDiZKpKSqgu2wOY0AnMbroUIx87R0Ve3vVmVuYs+CtWH6dE+UXrIyN1jqjXd/WyDspbP6vJzEY4ZG9I7A890xl0ph2GHb2K4s7h6iePVsNnkSN0SrcDYhC8WSUL8yZx/PfdhzWg/YE1SqqQL/hX3izsXI75OQVmndrkhrkN5tXex0+/7YdCronEOBTLsBVjhtilHR3g5lEKKrZDLZHTwEMIHjWNn6fbIy6vG6XBr57s0q6J7ue9S7q0dMptp9thFqLXdvPa7ta6uZb7J9khObLQNCVlXlNWisM=
file_glob: true
file: "*.vsix"
on:
repo: mauve/vscode-terraform
tags: true
| Package and deploy to releases page | Package and deploy to releases page
| YAML | mpl-2.0 | hashicorp/vscode-terraform,hashicorp/vscode-terraform,mauve/vscode-terraform,hashicorp/vscode-terraform,mauve/vscode-terraform,mauve/vscode-terraform,mauve/vscode-terraform | yaml | ## Code Before:
language: node_js
services:
- docker
node_js:
- "7"
env:
global:
- CXX=g++-4.9
- CC=gcc-4.9
- DISPLAY=:99.0
before_install:
- sh -e /etc/init.d/xvfb start
install:
- npm install --no-save
script:
- npm run gulp
- npm run integration-test
## Instruction:
Package and deploy to releases page
## Code After:
language: node_js
services:
- docker
node_js:
- '7'
env:
global:
- CXX=g++-4.9
- CC=gcc-4.9
- DISPLAY=:99.0
before_install:
- sh -e /etc/init.d/xvfb start
install:
- npm install --no-save
- npm install -g vsce
script:
- npm run gulp
- npm run integration-test
- vsce package
deploy:
provider: releases
api_key:
secure: mmkCO7tT+EUaKt//ksZFpJhX1ZMAN5P5dtgcIwWa7RTObNxblLndWTXwj5l6GmNm1LWAZ6ShXZ77Dtn/lmfbeldrfhoJ4NPC0pa5t6OijUIzJjp1BvUJpfLw3r5hrbpRVKb7cllKRMAs3PmMs055tr+KkbSGJn7Jp80+V275FfgbcdHYtMwblgXhTByvIFpvJ8oqg8+s9nd1hoXPgrAbAdU1hptvGzflx6tnQrZmbu43DmaYIy9BORBaMoAlVzUYHj0wX/xxCa88r3MxXB7WgVT+v8yNr34n/bkQ1Gv5DONicXIyOX4ANRXr2uHUP5hE3jxJszeBrskNU7mKz5fJuiN/hOOVMeiq9Cof3I+rISb1QHzBtiGrghczz73bep7d/OnZXxapjVDiZKpKSqgu2wOY0AnMbroUIx87R0Ve3vVmVuYs+CtWH6dE+UXrIyN1jqjXd/WyDspbP6vJzEY4ZG9I7A890xl0ph2GHb2K4s7h6iePVsNnkSN0SrcDYhC8WSUL8yZx/PfdhzWg/YE1SqqQL/hX3izsXI75OQVmndrkhrkN5tXex0+/7YdCronEOBTLsBVjhtilHR3g5lEKKrZDLZHTwEMIHjWNn6fbIy6vG6XBr57s0q6J7ue9S7q0dMptp9thFqLXdvPa7ta6uZb7J9khObLQNCVlXlNWisM=
file_glob: true
file: "*.vsix"
on:
repo: mauve/vscode-terraform
tags: true
| language: node_js
-
services:
- - docker
? --
+ - docker
-
node_js:
+ - '7'
- - "7"
-
env:
global:
- - CXX=g++-4.9
? --
+ - CXX=g++-4.9
- - CC=gcc-4.9
? --
+ - CC=gcc-4.9
- - DISPLAY=:99.0
? --
+ - DISPLAY=:99.0
-
before_install:
- - sh -e /etc/init.d/xvfb start
? --
+ - sh -e /etc/init.d/xvfb start
-
install:
- - npm install --no-save
? --
+ - npm install --no-save
-
+ - npm install -g vsce
script:
- - npm run gulp
? --
+ - npm run gulp
- - npm run integration-test
? --
+ - npm run integration-test
+ - vsce package
+ deploy:
+ provider: releases
+ api_key:
+ secure: mmkCO7tT+EUaKt//ksZFpJhX1ZMAN5P5dtgcIwWa7RTObNxblLndWTXwj5l6GmNm1LWAZ6ShXZ77Dtn/lmfbeldrfhoJ4NPC0pa5t6OijUIzJjp1BvUJpfLw3r5hrbpRVKb7cllKRMAs3PmMs055tr+KkbSGJn7Jp80+V275FfgbcdHYtMwblgXhTByvIFpvJ8oqg8+s9nd1hoXPgrAbAdU1hptvGzflx6tnQrZmbu43DmaYIy9BORBaMoAlVzUYHj0wX/xxCa88r3MxXB7WgVT+v8yNr34n/bkQ1Gv5DONicXIyOX4ANRXr2uHUP5hE3jxJszeBrskNU7mKz5fJuiN/hOOVMeiq9Cof3I+rISb1QHzBtiGrghczz73bep7d/OnZXxapjVDiZKpKSqgu2wOY0AnMbroUIx87R0Ve3vVmVuYs+CtWH6dE+UXrIyN1jqjXd/WyDspbP6vJzEY4ZG9I7A890xl0ph2GHb2K4s7h6iePVsNnkSN0SrcDYhC8WSUL8yZx/PfdhzWg/YE1SqqQL/hX3izsXI75OQVmndrkhrkN5tXex0+/7YdCronEOBTLsBVjhtilHR3g5lEKKrZDLZHTwEMIHjWNn6fbIy6vG6XBr57s0q6J7ue9S7q0dMptp9thFqLXdvPa7ta6uZb7J9khObLQNCVlXlNWisM=
+ file_glob: true
+ file: "*.vsix"
+ on:
+ repo: mauve/vscode-terraform
+ tags: true | 35 | 1.521739 | 20 | 15 |
34abc778d48cd3c38bf79957af1d0fa6ea39b392 | app/src/main/java/com/tekinarslan/kotlinrxjavasample/network/NetworkManager.kt | app/src/main/java/com/tekinarslan/kotlinrxjavasample/network/NetworkManager.kt | package com.tekinarslan.kotlinrxjavasample.network
import com.google.gson.GsonBuilder
import com.tekinarslan.kotlinrxjavasample.service.DataService
import okhttp3.OkHttpClient
import retrofit2.Retrofit
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
import retrofit2.converter.gson.GsonConverterFactory
/**
* Created by selimtekinarslan on 6/29/2017.
*/
class NetworkManager {
private var client: OkHttpClient? = null
var service: DataService? = null
init {
val retrofit = Retrofit.Builder()
.baseUrl("https://jsonplaceholder.typicode.com")
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.addConverterFactory(GsonConverterFactory.create(GsonBuilder().create()))
.client(createOkHttpClient())
.build()
createServices(retrofit)
}
fun createServices(retrofit: Retrofit) {
service = retrofit.create(DataService::class.java)
}
fun createOkHttpClient(): OkHttpClient {
if (client == null) {
client = OkHttpClient()
}
return client as OkHttpClient
}
} | package com.tekinarslan.kotlinrxjavasample.network
import com.google.gson.GsonBuilder
import com.tekinarslan.kotlinrxjavasample.service.DataService
import okhttp3.OkHttpClient
import retrofit2.Retrofit
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
import retrofit2.converter.gson.GsonConverterFactory
/**
* Created by selimtekinarslan on 6/29/2017.
*/
class NetworkManager {
lateinit var service: DataService
init {
val retrofit = Retrofit.Builder()
.baseUrl("https://jsonplaceholder.typicode.com")
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.addConverterFactory(GsonConverterFactory.create(GsonBuilder().create()))
.client(OkHttpClient())
.build()
createServices(retrofit)
}
fun createServices(retrofit: Retrofit) {
service = retrofit.create(DataService::class.java)
}
} | Use lateinit instead of null type. | Use lateinit instead of null type.
| Kotlin | apache-2.0 | tekinarslan/RxJavaKotlinSample | kotlin | ## Code Before:
package com.tekinarslan.kotlinrxjavasample.network
import com.google.gson.GsonBuilder
import com.tekinarslan.kotlinrxjavasample.service.DataService
import okhttp3.OkHttpClient
import retrofit2.Retrofit
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
import retrofit2.converter.gson.GsonConverterFactory
/**
* Created by selimtekinarslan on 6/29/2017.
*/
class NetworkManager {
private var client: OkHttpClient? = null
var service: DataService? = null
init {
val retrofit = Retrofit.Builder()
.baseUrl("https://jsonplaceholder.typicode.com")
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.addConverterFactory(GsonConverterFactory.create(GsonBuilder().create()))
.client(createOkHttpClient())
.build()
createServices(retrofit)
}
fun createServices(retrofit: Retrofit) {
service = retrofit.create(DataService::class.java)
}
fun createOkHttpClient(): OkHttpClient {
if (client == null) {
client = OkHttpClient()
}
return client as OkHttpClient
}
}
## Instruction:
Use lateinit instead of null type.
## Code After:
package com.tekinarslan.kotlinrxjavasample.network
import com.google.gson.GsonBuilder
import com.tekinarslan.kotlinrxjavasample.service.DataService
import okhttp3.OkHttpClient
import retrofit2.Retrofit
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
import retrofit2.converter.gson.GsonConverterFactory
/**
* Created by selimtekinarslan on 6/29/2017.
*/
class NetworkManager {
lateinit var service: DataService
init {
val retrofit = Retrofit.Builder()
.baseUrl("https://jsonplaceholder.typicode.com")
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.addConverterFactory(GsonConverterFactory.create(GsonBuilder().create()))
.client(OkHttpClient())
.build()
createServices(retrofit)
}
fun createServices(retrofit: Retrofit) {
service = retrofit.create(DataService::class.java)
}
} | package com.tekinarslan.kotlinrxjavasample.network
import com.google.gson.GsonBuilder
import com.tekinarslan.kotlinrxjavasample.service.DataService
import okhttp3.OkHttpClient
import retrofit2.Retrofit
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
import retrofit2.converter.gson.GsonConverterFactory
/**
* Created by selimtekinarslan on 6/29/2017.
*/
class NetworkManager {
- private var client: OkHttpClient? = null
- var service: DataService? = null
? --------
+ lateinit var service: DataService
? +++++++++
init {
val retrofit = Retrofit.Builder()
.baseUrl("https://jsonplaceholder.typicode.com")
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.addConverterFactory(GsonConverterFactory.create(GsonBuilder().create()))
- .client(createOkHttpClient())
? ------
+ .client(OkHttpClient())
.build()
createServices(retrofit)
}
fun createServices(retrofit: Retrofit) {
service = retrofit.create(DataService::class.java)
}
-
- fun createOkHttpClient(): OkHttpClient {
- if (client == null) {
- client = OkHttpClient()
- }
- return client as OkHttpClient
- }
-
} | 13 | 0.325 | 2 | 11 |
fe58c1f13cc0758bbbd8f85b8794b458b3a72b55 | app/views/projects/buttons/_notifications.html.haml | app/views/projects/buttons/_notifications.html.haml | - if @notification_setting
= form_for [@project.namespace.becomes(Namespace), @project, @notification_setting], remote: true, html: { class: 'inline', id: 'notification-form' } do |f|
= f.hidden_field :level
%span.dropdown
%a.dropdown-new.btn.notifications-btn#notifications-button{href: '#', "data-toggle" => "dropdown"}
= icon('bell')
= notification_title(@notification_setting.level)
= icon('angle-down')
%ul.dropdown-menu.dropdown-menu-right.project-home-dropdown
- NotificationSetting.levels.each do |level|
= notification_list_item(level.first, @notification_setting)
| - if @notification_setting
= form_for @notification_setting, url: namespace_project_notification_setting_path(@project.namespace.becomes(Namespace), @project), remote: true, html: { class: 'inline', id: 'notification-form' } do |f|
= f.hidden_field :level
%span.dropdown
%a.dropdown-new.btn.notifications-btn#notifications-button{href: '#', "data-toggle" => "dropdown"}
= icon('bell')
= notification_title(@notification_setting.level)
= icon('angle-down')
%ul.dropdown-menu.dropdown-menu-right.project-home-dropdown
- NotificationSetting.levels.each do |level|
= notification_list_item(level.first, @notification_setting)
| Fix partial for update project notifications | Fix partial for update project notifications
| Haml | mit | openwide-java/gitlabhq,allysonbarros/gitlabhq,LUMC/gitlabhq,mr-dxdy/gitlabhq,jirutka/gitlabhq,axilleas/gitlabhq,axilleas/gitlabhq,daiyu/gitlab-zh,icedwater/gitlabhq,mmkassem/gitlabhq,dreampet/gitlab,allysonbarros/gitlabhq,icedwater/gitlabhq,larryli/gitlabhq,darkrasid/gitlabhq,dreampet/gitlab,LUMC/gitlabhq,mr-dxdy/gitlabhq,dwrensha/gitlabhq,t-zuehlsdorff/gitlabhq,mr-dxdy/gitlabhq,larryli/gitlabhq,SVArago/gitlabhq,darkrasid/gitlabhq,Soullivaneuh/gitlabhq,martijnvermaat/gitlabhq,openwide-java/gitlabhq,dwrensha/gitlabhq,jirutka/gitlabhq,shinexiao/gitlabhq,icedwater/gitlabhq,SVArago/gitlabhq,daiyu/gitlab-zh,shinexiao/gitlabhq,dreampet/gitlab,SVArago/gitlabhq,LUMC/gitlabhq,htve/GitlabForChinese,openwide-java/gitlabhq,darkrasid/gitlabhq,martijnvermaat/gitlabhq,mmkassem/gitlabhq,allysonbarros/gitlabhq,screenpages/gitlabhq,martijnvermaat/gitlabhq,t-zuehlsdorff/gitlabhq,LUMC/gitlabhq,shinexiao/gitlabhq,martijnvermaat/gitlabhq,allysonbarros/gitlabhq,stoplightio/gitlabhq,shinexiao/gitlabhq,mmkassem/gitlabhq,larryli/gitlabhq,larryli/gitlabhq,openwide-java/gitlabhq,t-zuehlsdorff/gitlabhq,stoplightio/gitlabhq,Soullivaneuh/gitlabhq,Soullivaneuh/gitlabhq,dplarson/gitlabhq,htve/GitlabForChinese,icedwater/gitlabhq,jirutka/gitlabhq,jirutka/gitlabhq,iiet/iiet-git,daiyu/gitlab-zh,screenpages/gitlabhq,dplarson/gitlabhq,iiet/iiet-git,axilleas/gitlabhq,mmkassem/gitlabhq,dplarson/gitlabhq,daiyu/gitlab-zh,dwrensha/gitlabhq,stoplightio/gitlabhq,iiet/iiet-git,SVArago/gitlabhq,mr-dxdy/gitlabhq,darkrasid/gitlabhq,t-zuehlsdorff/gitlabhq,Soullivaneuh/gitlabhq,htve/GitlabForChinese,htve/GitlabForChinese,dplarson/gitlabhq,screenpages/gitlabhq,stoplightio/gitlabhq,axilleas/gitlabhq,dwrensha/gitlabhq,iiet/iiet-git,screenpages/gitlabhq,dreampet/gitlab | haml | ## Code Before:
- if @notification_setting
= form_for [@project.namespace.becomes(Namespace), @project, @notification_setting], remote: true, html: { class: 'inline', id: 'notification-form' } do |f|
= f.hidden_field :level
%span.dropdown
%a.dropdown-new.btn.notifications-btn#notifications-button{href: '#', "data-toggle" => "dropdown"}
= icon('bell')
= notification_title(@notification_setting.level)
= icon('angle-down')
%ul.dropdown-menu.dropdown-menu-right.project-home-dropdown
- NotificationSetting.levels.each do |level|
= notification_list_item(level.first, @notification_setting)
## Instruction:
Fix partial for update project notifications
## Code After:
- if @notification_setting
= form_for @notification_setting, url: namespace_project_notification_setting_path(@project.namespace.becomes(Namespace), @project), remote: true, html: { class: 'inline', id: 'notification-form' } do |f|
= f.hidden_field :level
%span.dropdown
%a.dropdown-new.btn.notifications-btn#notifications-button{href: '#', "data-toggle" => "dropdown"}
= icon('bell')
= notification_title(@notification_setting.level)
= icon('angle-down')
%ul.dropdown-menu.dropdown-menu-right.project-home-dropdown
- NotificationSetting.levels.each do |level|
= notification_list_item(level.first, @notification_setting)
| - if @notification_setting
- = form_for [@project.namespace.becomes(Namespace), @project, @notification_setting], remote: true, html: { class: 'inline', id: 'notification-form' } do |f|
+ = form_for @notification_setting, url: namespace_project_notification_setting_path(@project.namespace.becomes(Namespace), @project), remote: true, html: { class: 'inline', id: 'notification-form' } do |f|
= f.hidden_field :level
%span.dropdown
%a.dropdown-new.btn.notifications-btn#notifications-button{href: '#', "data-toggle" => "dropdown"}
= icon('bell')
= notification_title(@notification_setting.level)
= icon('angle-down')
%ul.dropdown-menu.dropdown-menu-right.project-home-dropdown
- NotificationSetting.levels.each do |level|
= notification_list_item(level.first, @notification_setting) | 2 | 0.181818 | 1 | 1 |
66cf4764acfaceceb3a86387f6e54e20188eb797 | api/src/Validator/MaterialItemUpdateGroupSequence.php | api/src/Validator/MaterialItemUpdateGroupSequence.php | <?php
namespace App\Validator;
use Symfony\Component\Validator\Constraints\GroupSequence;
class MaterialItemUpdateGroupSequence {
public function __invoke() {
return new GroupSequence(['materialItem:update', 'Default']); // now, no matter which is first in the class declaration, it will be tested in this order.
}
}
| <?php
namespace App\Validator;
use ApiPlatform\Core\Bridge\Symfony\Validator\ValidationGroupsGeneratorInterface;
use Symfony\Component\Validator\Constraints\GroupSequence;
class MaterialItemUpdateGroupSequence implements ValidationGroupsGeneratorInterface {
public function __invoke($object) {
return new GroupSequence(['materialItem:update', 'Default']); // now, no matter which is first in the class declaration, it will be tested in this order.
}
}
| Fix deprecation warnings for api platform 2.6 | Fix deprecation warnings for api platform 2.6
| PHP | agpl-3.0 | ecamp/ecamp3,usu/ecamp3,usu/ecamp3,pmattmann/ecamp3,usu/ecamp3,ecamp/ecamp3,ecamp/ecamp3,ecamp/ecamp3,pmattmann/ecamp3,usu/ecamp3,pmattmann/ecamp3,pmattmann/ecamp3 | php | ## Code Before:
<?php
namespace App\Validator;
use Symfony\Component\Validator\Constraints\GroupSequence;
class MaterialItemUpdateGroupSequence {
public function __invoke() {
return new GroupSequence(['materialItem:update', 'Default']); // now, no matter which is first in the class declaration, it will be tested in this order.
}
}
## Instruction:
Fix deprecation warnings for api platform 2.6
## Code After:
<?php
namespace App\Validator;
use ApiPlatform\Core\Bridge\Symfony\Validator\ValidationGroupsGeneratorInterface;
use Symfony\Component\Validator\Constraints\GroupSequence;
class MaterialItemUpdateGroupSequence implements ValidationGroupsGeneratorInterface {
public function __invoke($object) {
return new GroupSequence(['materialItem:update', 'Default']); // now, no matter which is first in the class declaration, it will be tested in this order.
}
}
| <?php
namespace App\Validator;
+ use ApiPlatform\Core\Bridge\Symfony\Validator\ValidationGroupsGeneratorInterface;
use Symfony\Component\Validator\Constraints\GroupSequence;
- class MaterialItemUpdateGroupSequence {
+ class MaterialItemUpdateGroupSequence implements ValidationGroupsGeneratorInterface {
- public function __invoke() {
+ public function __invoke($object) {
? +++++++
return new GroupSequence(['materialItem:update', 'Default']); // now, no matter which is first in the class declaration, it will be tested in this order.
}
} | 5 | 0.454545 | 3 | 2 |
025c8cc6417ccc16ce540249115235e9912e32c0 | docs/make.jl | docs/make.jl | using Documenter, Optim
# use include("Rosenbrock.jl") etc
# assuming linux.
#run('mv ../LICENSE.md ./LICENSE.md')
#run('mv ../CONTRIBUTING.md ./dev/CONTRIBUTING.md')
makedocs(
doctest = false
)
deploydocs(
repo = "github.com/JuliaOpt/Optim.jl.git"
)
| using Documenter, Optim
# use include("Rosenbrock.jl") etc
# assuming linux.
#run('mv ../LICENSE.md ./LICENSE.md')
#run('mv ../CONTRIBUTING.md ./dev/CONTRIBUTING.md')
makedocs(
doctest = false
)
deploydocs(
repo = "github.com/JuliaOpt/Optim.jl.git",
julia = "0.5"
)
| Fix Documenter by changing from nightly to v0.5. | Fix Documenter by changing from nightly to v0.5.
| Julia | mit | matthieugomez/Optim.jl,matthieugomez/Optim.jl,JuliaPackageMirrors/Optim.jl,JuliaPackageMirrors/Optim.jl | julia | ## Code Before:
using Documenter, Optim
# use include("Rosenbrock.jl") etc
# assuming linux.
#run('mv ../LICENSE.md ./LICENSE.md')
#run('mv ../CONTRIBUTING.md ./dev/CONTRIBUTING.md')
makedocs(
doctest = false
)
deploydocs(
repo = "github.com/JuliaOpt/Optim.jl.git"
)
## Instruction:
Fix Documenter by changing from nightly to v0.5.
## Code After:
using Documenter, Optim
# use include("Rosenbrock.jl") etc
# assuming linux.
#run('mv ../LICENSE.md ./LICENSE.md')
#run('mv ../CONTRIBUTING.md ./dev/CONTRIBUTING.md')
makedocs(
doctest = false
)
deploydocs(
repo = "github.com/JuliaOpt/Optim.jl.git",
julia = "0.5"
)
| using Documenter, Optim
# use include("Rosenbrock.jl") etc
# assuming linux.
#run('mv ../LICENSE.md ./LICENSE.md')
#run('mv ../CONTRIBUTING.md ./dev/CONTRIBUTING.md')
makedocs(
doctest = false
)
deploydocs(
- repo = "github.com/JuliaOpt/Optim.jl.git"
+ repo = "github.com/JuliaOpt/Optim.jl.git",
? +
+ julia = "0.5"
) | 3 | 0.214286 | 2 | 1 |
fea6d308591b687078dad90ff523616eb818e206 | storyboard/plugin/email/templates/task/PUT.txt | storyboard/plugin/email/templates/task/PUT.txt | Task "{{resource.title}}" was updated by {{author.full_name}}:
URL: {{url}}#!/story/{{resource.story.id}}
Full Task Details:
Task: {{resource.title}}
Story: {{resource.story.title}}
Project: {{resource.project.name}}
Assignee: {{resource.assignee.full_name}}
Status: {{resource.status}}
Priority: {{resource.priority}}
Type of Change: {{after}}
(prior to change, {{before}} )
| Task "{{resource.title}}" was updated by {{author.full_name}}:
URL: {{url}}#!/story/{{resource.story.id}}
Full Task Details:
Task: {{resource.title}}
Story: {{resource.story.title}}
Project: {{resource.project.name}}
Assignee: {{resource.assignee.full_name}}
Status: {{resource.status}}
Priority: {{resource.priority}}
Notes: {{resource.link}}
Type of Change: {{after}}
(prior to change, {{before}} )
| Add task notes to task email | Add task notes to task email
This adds task notes to the list of task properties in the 'task
details changed' email.
Change-Id: Iec498706c91e053d235e8fed721d017b8608608f
| Text | apache-2.0 | ColdrickSotK/storyboard,ColdrickSotK/storyboard,ColdrickSotK/storyboard | text | ## Code Before:
Task "{{resource.title}}" was updated by {{author.full_name}}:
URL: {{url}}#!/story/{{resource.story.id}}
Full Task Details:
Task: {{resource.title}}
Story: {{resource.story.title}}
Project: {{resource.project.name}}
Assignee: {{resource.assignee.full_name}}
Status: {{resource.status}}
Priority: {{resource.priority}}
Type of Change: {{after}}
(prior to change, {{before}} )
## Instruction:
Add task notes to task email
This adds task notes to the list of task properties in the 'task
details changed' email.
Change-Id: Iec498706c91e053d235e8fed721d017b8608608f
## Code After:
Task "{{resource.title}}" was updated by {{author.full_name}}:
URL: {{url}}#!/story/{{resource.story.id}}
Full Task Details:
Task: {{resource.title}}
Story: {{resource.story.title}}
Project: {{resource.project.name}}
Assignee: {{resource.assignee.full_name}}
Status: {{resource.status}}
Priority: {{resource.priority}}
Notes: {{resource.link}}
Type of Change: {{after}}
(prior to change, {{before}} )
| Task "{{resource.title}}" was updated by {{author.full_name}}:
URL: {{url}}#!/story/{{resource.story.id}}
Full Task Details:
Task: {{resource.title}}
Story: {{resource.story.title}}
Project: {{resource.project.name}}
Assignee: {{resource.assignee.full_name}}
Status: {{resource.status}}
Priority: {{resource.priority}}
+ Notes: {{resource.link}}
Type of Change: {{after}}
(prior to change, {{before}} ) | 1 | 0.066667 | 1 | 0 |
bbf293444aae97c341a03a3b0e60c0e00c414d01 | lib/fieldhand/datestamp.rb | lib/fieldhand/datestamp.rb | require 'date'
require 'time'
module Fieldhand
# A class to handle datestamps of varying granularity.
class Datestamp
def self.parse(datestamp)
if datestamp.size == 10
::Date.xmlschema(datestamp)
else
::Time.xmlschema(datestamp)
end
end
def self.unparse(datestamp)
return datestamp if datestamp.is_a?(::String)
datestamp.xmlschema
end
end
end
| require 'date'
require 'time'
module Fieldhand
# A class to handle datestamps of varying granularity.
class Datestamp
def self.parse(datestamp)
if datestamp.size == 10
::Date.strptime(datestamp)
else
::Time.xmlschema(datestamp)
end
end
def self.unparse(datestamp)
return datestamp if datestamp.is_a?(::String)
return datestamp.xmlschema if datestamp.respond_to?(:xmlschema)
datestamp.strftime
end
end
end
| Support date parsing in older Rubies | Support date parsing in older Rubies
Date did not gain xmlschema parsing and formatting until Ruby 1.9.1 but
the same can be achieved through strptime and strftime.
| Ruby | mit | altmetric/fieldhand | ruby | ## Code Before:
require 'date'
require 'time'
module Fieldhand
# A class to handle datestamps of varying granularity.
class Datestamp
def self.parse(datestamp)
if datestamp.size == 10
::Date.xmlschema(datestamp)
else
::Time.xmlschema(datestamp)
end
end
def self.unparse(datestamp)
return datestamp if datestamp.is_a?(::String)
datestamp.xmlschema
end
end
end
## Instruction:
Support date parsing in older Rubies
Date did not gain xmlschema parsing and formatting until Ruby 1.9.1 but
the same can be achieved through strptime and strftime.
## Code After:
require 'date'
require 'time'
module Fieldhand
# A class to handle datestamps of varying granularity.
class Datestamp
def self.parse(datestamp)
if datestamp.size == 10
::Date.strptime(datestamp)
else
::Time.xmlschema(datestamp)
end
end
def self.unparse(datestamp)
return datestamp if datestamp.is_a?(::String)
return datestamp.xmlschema if datestamp.respond_to?(:xmlschema)
datestamp.strftime
end
end
end
| require 'date'
require 'time'
module Fieldhand
# A class to handle datestamps of varying granularity.
class Datestamp
def self.parse(datestamp)
if datestamp.size == 10
- ::Date.xmlschema(datestamp)
? ^ ---- --
+ ::Date.strptime(datestamp)
? ^^^^^^
else
::Time.xmlschema(datestamp)
end
end
def self.unparse(datestamp)
return datestamp if datestamp.is_a?(::String)
+ return datestamp.xmlschema if datestamp.respond_to?(:xmlschema)
- datestamp.xmlschema
+ datestamp.strftime
end
end
end | 5 | 0.238095 | 3 | 2 |
8aae2526f4e565982f8c57c25d796c59d17e6c46 | components/lie_graph/lie_graph/graph_model_classes/model_files.py | components/lie_graph/lie_graph/graph_model_classes/model_files.py |
import os
import logging
from lie_graph.graph_mixin import NodeEdgeToolsBaseClass
class FilePath(NodeEdgeToolsBaseClass):
@property
def exists(self):
path = self.get()
if path:
return os.path.exists(path)
return False
@property
def iswritable(self):
return os.access(self.get(), os.W_OK)
def set(self, key, value=None, absolute=True):
if key == self.node_value_tag and absolute:
value = os.path.abspath(value)
self.nodes[self.nid][key] = value
def create_dirs(self):
"""
Create directories of the stored path
:return: Absolute path to working directory
:rtype: :py:str
"""
path = self.get()
if self.exists and self.iswritable:
logging.info('Directory exists and writable: {0}'.format(path))
return path
try:
os.makedirs(path, 0755)
except Exception:
logging.error('Unable to create project directory: {0}'.format(path))
return path
|
import os
import logging
from lie_graph.graph_mixin import NodeEdgeToolsBaseClass
class FilePath(NodeEdgeToolsBaseClass):
@property
def exists(self):
path = self.get()
if path:
return os.path.exists(path)
return False
@property
def iswritable(self):
return os.access(self.get(), os.W_OK)
def set(self, key, value=None, absolute=True):
if key == self.node_value_tag and absolute:
value = os.path.abspath(value)
self.nodes[self.nid][key] = value
def makedirs(self):
"""
Recursively create the directory structure of the path
:return: Absolute path to working directory
:rtype: :py:str
"""
path = self.get()
if self.exists and self.iswritable:
logging.info('Directory exists and writable: {0}'.format(path))
return path
try:
os.makedirs(path, 0755)
except Exception:
logging.error('Unable to create project directory: {0}'.format(path))
return path
| Rename create_dirs method to makedirs in line with os.path method | Rename create_dirs method to makedirs in line with os.path method
| Python | apache-2.0 | MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio | python | ## Code Before:
import os
import logging
from lie_graph.graph_mixin import NodeEdgeToolsBaseClass
class FilePath(NodeEdgeToolsBaseClass):
@property
def exists(self):
path = self.get()
if path:
return os.path.exists(path)
return False
@property
def iswritable(self):
return os.access(self.get(), os.W_OK)
def set(self, key, value=None, absolute=True):
if key == self.node_value_tag and absolute:
value = os.path.abspath(value)
self.nodes[self.nid][key] = value
def create_dirs(self):
"""
Create directories of the stored path
:return: Absolute path to working directory
:rtype: :py:str
"""
path = self.get()
if self.exists and self.iswritable:
logging.info('Directory exists and writable: {0}'.format(path))
return path
try:
os.makedirs(path, 0755)
except Exception:
logging.error('Unable to create project directory: {0}'.format(path))
return path
## Instruction:
Rename create_dirs method to makedirs in line with os.path method
## Code After:
import os
import logging
from lie_graph.graph_mixin import NodeEdgeToolsBaseClass
class FilePath(NodeEdgeToolsBaseClass):
@property
def exists(self):
path = self.get()
if path:
return os.path.exists(path)
return False
@property
def iswritable(self):
return os.access(self.get(), os.W_OK)
def set(self, key, value=None, absolute=True):
if key == self.node_value_tag and absolute:
value = os.path.abspath(value)
self.nodes[self.nid][key] = value
def makedirs(self):
"""
Recursively create the directory structure of the path
:return: Absolute path to working directory
:rtype: :py:str
"""
path = self.get()
if self.exists and self.iswritable:
logging.info('Directory exists and writable: {0}'.format(path))
return path
try:
os.makedirs(path, 0755)
except Exception:
logging.error('Unable to create project directory: {0}'.format(path))
return path
|
import os
import logging
from lie_graph.graph_mixin import NodeEdgeToolsBaseClass
class FilePath(NodeEdgeToolsBaseClass):
@property
def exists(self):
path = self.get()
if path:
return os.path.exists(path)
return False
@property
def iswritable(self):
return os.access(self.get(), os.W_OK)
def set(self, key, value=None, absolute=True):
if key == self.node_value_tag and absolute:
value = os.path.abspath(value)
self.nodes[self.nid][key] = value
- def create_dirs(self):
? ^^ ----
+ def makedirs(self):
? ^^^
"""
- Create directories of the stored path
+ Recursively create the directory structure of the path
:return: Absolute path to working directory
:rtype: :py:str
"""
path = self.get()
if self.exists and self.iswritable:
logging.info('Directory exists and writable: {0}'.format(path))
return path
try:
os.makedirs(path, 0755)
except Exception:
logging.error('Unable to create project directory: {0}'.format(path))
return path | 4 | 0.083333 | 2 | 2 |
cdf3ee4379e2db589d3acb64bb1ddb6276960b4b | Code/Main/shared/src/main/scala/rescala/reactives/InvariantViolationException.scala | Code/Main/shared/src/main/scala/rescala/reactives/InvariantViolationException.scala | package rescala.reactives
import rescala.core.{ReSource}
import rescala.extra.simpleprop.invariant.SimpleStruct
class InvariantViolationException(t: Throwable, reactive: ReSource[SimpleStruct], causalErrorChains: Seq[Seq[ReSource[SimpleStruct]]])
extends RuntimeException {
override def getMessage: String = {
val chainErrorMessage = if (causalErrorChains.nonEmpty)
"The error was caused by these update chains:\n\n" ++ causalErrorChains.map(_.map(_.name.str).mkString("\n↓\n")).mkString("\n---\n")
else "The error was not triggered by a change."
s"${t.getMessage} in reactive ${reactive.name.str}\n$chainErrorMessage\n"
}
override def fillInStackTrace() = this
}
| package rescala.reactives
import rescala.core.{ReSource}
import rescala.extra.simpleprop.invariant.SimpleStruct
class InvariantViolationException(t: Throwable, reactive: ReSource[SimpleStruct], causalErrorChains: Seq[Seq[ReSource[SimpleStruct]]])
extends RuntimeException {
override def getMessage: String = {
val chainErrorMessage = if (causalErrorChains.nonEmpty)
"The error was caused by these update chains:\n\n" ++ causalErrorChains.map(_.map(r => s"${r.name.str} with value: ${r.state.value}").mkString("\n↓\n")).mkString("\n---\n")
else "The error was not triggered by a change."
s"${t.getMessage} in reactive ${reactive.name.str}\n$chainErrorMessage\n"
}
override def fillInStackTrace() = this
}
| Print value for elements in error chain | Print value for elements in error chain
| Scala | apache-2.0 | guidosalva/REScala,guidosalva/REScala | scala | ## Code Before:
package rescala.reactives
import rescala.core.{ReSource}
import rescala.extra.simpleprop.invariant.SimpleStruct
class InvariantViolationException(t: Throwable, reactive: ReSource[SimpleStruct], causalErrorChains: Seq[Seq[ReSource[SimpleStruct]]])
extends RuntimeException {
override def getMessage: String = {
val chainErrorMessage = if (causalErrorChains.nonEmpty)
"The error was caused by these update chains:\n\n" ++ causalErrorChains.map(_.map(_.name.str).mkString("\n↓\n")).mkString("\n---\n")
else "The error was not triggered by a change."
s"${t.getMessage} in reactive ${reactive.name.str}\n$chainErrorMessage\n"
}
override def fillInStackTrace() = this
}
## Instruction:
Print value for elements in error chain
## Code After:
package rescala.reactives
import rescala.core.{ReSource}
import rescala.extra.simpleprop.invariant.SimpleStruct
class InvariantViolationException(t: Throwable, reactive: ReSource[SimpleStruct], causalErrorChains: Seq[Seq[ReSource[SimpleStruct]]])
extends RuntimeException {
override def getMessage: String = {
val chainErrorMessage = if (causalErrorChains.nonEmpty)
"The error was caused by these update chains:\n\n" ++ causalErrorChains.map(_.map(r => s"${r.name.str} with value: ${r.state.value}").mkString("\n↓\n")).mkString("\n---\n")
else "The error was not triggered by a change."
s"${t.getMessage} in reactive ${reactive.name.str}\n$chainErrorMessage\n"
}
override def fillInStackTrace() = this
}
| package rescala.reactives
import rescala.core.{ReSource}
import rescala.extra.simpleprop.invariant.SimpleStruct
class InvariantViolationException(t: Throwable, reactive: ReSource[SimpleStruct], causalErrorChains: Seq[Seq[ReSource[SimpleStruct]]])
extends RuntimeException {
override def getMessage: String = {
val chainErrorMessage = if (causalErrorChains.nonEmpty)
- "The error was caused by these update chains:\n\n" ++ causalErrorChains.map(_.map(_.name.str).mkString("\n↓\n")).mkString("\n---\n")
? ^
+ "The error was caused by these update chains:\n\n" ++ causalErrorChains.map(_.map(r => s"${r.name.str} with value: ${r.state.value}").mkString("\n↓\n")).mkString("\n---\n")
? ^^^^^^^^^^ +++++++++++++++++++++++++++++++
else "The error was not triggered by a change."
s"${t.getMessage} in reactive ${reactive.name.str}\n$chainErrorMessage\n"
}
override def fillInStackTrace() = this
} | 2 | 0.111111 | 1 | 1 |
e31790412c9e869841b448f3e7f8bb4a965da81d | mygpo/web/templatetags/devices.py | mygpo/web/templatetags/devices.py | from django import template
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from mygpo.api.models import DEVICE_TYPES
register = template.Library()
# Create a dictionary of device_type -> caption mappings
DEVICE_TYPES_DICT = dict(DEVICE_TYPES)
# This dictionary maps device types to their icon files
DEVICE_TYPE_ICONS = {
'desktop': 'computer.png',
'laptop': 'stock_notebook.png',
'mobile': 'stock_cell-phone.png',
'server': 'server.png',
'other': 'audio-x-generic.png',
}
@register.filter
def device_icon(device, size=16):
icon = DEVICE_TYPE_ICONS.get(device, None)
caption = DEVICE_TYPES_DICT.get(device, None)
if icon is not None and caption is not None:
html = ('<img src="/media/%(size)dx%(size)d/%(icon)s" '+
'alt="%(caption)s" class="device_icon"/>') % locals()
return mark_safe(html)
return ''
@register.filter
def device_list(devices):
return mark_safe(', '.join([ '<a href="/device/%s">%s %s</a>' % (d.id, device_icon(d), d.name) for d in devices]))
| from django import template
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from mygpo.api.models import DEVICE_TYPES
register = template.Library()
# Create a dictionary of device_type -> caption mappings
DEVICE_TYPES_DICT = dict(DEVICE_TYPES)
# This dictionary maps device types to their icon files
DEVICE_TYPE_ICONS = {
'desktop': 'computer.png',
'laptop': 'stock_notebook.png',
'mobile': 'stock_cell-phone.png',
'server': 'server.png',
'other': 'audio-x-generic.png',
}
@register.filter
def device_icon(device, size=16):
icon = DEVICE_TYPE_ICONS.get(device.type, None)
caption = DEVICE_TYPES_DICT.get(device.type, None)
if icon is not None and caption is not None:
html = ('<img src="/media/%(size)dx%(size)d/%(icon)s" '+
'alt="%(caption)s" class="device_icon"/>') % locals()
return mark_safe(html)
return ''
@register.filter
def device_list(devices):
return mark_safe(', '.join([ '<a href="/device/%s">%s %s</a>' % (d.id, device_icon(d), d.name) for d in devices]))
| Fix problem with device icons | Fix problem with device icons
| Python | agpl-3.0 | gpodder/mygpo,gpodder/mygpo,gpodder/mygpo,gpodder/mygpo | python | ## Code Before:
from django import template
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from mygpo.api.models import DEVICE_TYPES
register = template.Library()
# Create a dictionary of device_type -> caption mappings
DEVICE_TYPES_DICT = dict(DEVICE_TYPES)
# This dictionary maps device types to their icon files
DEVICE_TYPE_ICONS = {
'desktop': 'computer.png',
'laptop': 'stock_notebook.png',
'mobile': 'stock_cell-phone.png',
'server': 'server.png',
'other': 'audio-x-generic.png',
}
@register.filter
def device_icon(device, size=16):
icon = DEVICE_TYPE_ICONS.get(device, None)
caption = DEVICE_TYPES_DICT.get(device, None)
if icon is not None and caption is not None:
html = ('<img src="/media/%(size)dx%(size)d/%(icon)s" '+
'alt="%(caption)s" class="device_icon"/>') % locals()
return mark_safe(html)
return ''
@register.filter
def device_list(devices):
return mark_safe(', '.join([ '<a href="/device/%s">%s %s</a>' % (d.id, device_icon(d), d.name) for d in devices]))
## Instruction:
Fix problem with device icons
## Code After:
from django import template
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from mygpo.api.models import DEVICE_TYPES
register = template.Library()
# Create a dictionary of device_type -> caption mappings
DEVICE_TYPES_DICT = dict(DEVICE_TYPES)
# This dictionary maps device types to their icon files
DEVICE_TYPE_ICONS = {
'desktop': 'computer.png',
'laptop': 'stock_notebook.png',
'mobile': 'stock_cell-phone.png',
'server': 'server.png',
'other': 'audio-x-generic.png',
}
@register.filter
def device_icon(device, size=16):
icon = DEVICE_TYPE_ICONS.get(device.type, None)
caption = DEVICE_TYPES_DICT.get(device.type, None)
if icon is not None and caption is not None:
html = ('<img src="/media/%(size)dx%(size)d/%(icon)s" '+
'alt="%(caption)s" class="device_icon"/>') % locals()
return mark_safe(html)
return ''
@register.filter
def device_list(devices):
return mark_safe(', '.join([ '<a href="/device/%s">%s %s</a>' % (d.id, device_icon(d), d.name) for d in devices]))
| from django import template
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from mygpo.api.models import DEVICE_TYPES
register = template.Library()
# Create a dictionary of device_type -> caption mappings
DEVICE_TYPES_DICT = dict(DEVICE_TYPES)
# This dictionary maps device types to their icon files
DEVICE_TYPE_ICONS = {
'desktop': 'computer.png',
'laptop': 'stock_notebook.png',
'mobile': 'stock_cell-phone.png',
'server': 'server.png',
'other': 'audio-x-generic.png',
}
@register.filter
def device_icon(device, size=16):
- icon = DEVICE_TYPE_ICONS.get(device, None)
+ icon = DEVICE_TYPE_ICONS.get(device.type, None)
? +++++
- caption = DEVICE_TYPES_DICT.get(device, None)
+ caption = DEVICE_TYPES_DICT.get(device.type, None)
? +++++
if icon is not None and caption is not None:
html = ('<img src="/media/%(size)dx%(size)d/%(icon)s" '+
'alt="%(caption)s" class="device_icon"/>') % locals()
return mark_safe(html)
return ''
@register.filter
def device_list(devices):
return mark_safe(', '.join([ '<a href="/device/%s">%s %s</a>' % (d.id, device_icon(d), d.name) for d in devices]))
| 4 | 0.111111 | 2 | 2 |
ad09417676aecc1ce2585fd8cae25a8e877eff2f | index.js | index.js | 'use strict';
var _ = require('lodash-node'),
es = require('event-stream'),
PluginError = require('gulp-util').PluginError,
Cache = require('cache-swap'),
TaskProxy = require('./lib/TaskProxy');
var fileCache = new Cache({
cacheDirName: 'gulp-cache'
});
var defaultOptions = {
fileCache: fileCache,
key: _.noop,
success: _.noop,
value: _.noop
};
var cacheTask = {
proxy: function (name, opts) {
// Check if name was not passed, use default
if (_.isObject(name)) {
opts = name;
name = 'default';
}
var self = this;
// Make sure we have some sane defaults
opts = _.defaults(opts || {}, defaultOptions);
// Check for required task option
if (!opts.task) {
throw new PluginError('gulp-cache', 'Must pass a task to ' + name + ' cache.proxy');
}
// Pass through the file and cb to _processFile along with the opts
return es.map(function (file, cb) {
var taskProxy = new TaskProxy({
name: name,
file: file,
opts: opts
});
taskProxy.processFile().then(function (result) {
cb(null, result);
}).catch(function (err) {
cb(new PluginError('gulp-cache', 'Error proxying task ' + self.name + ': ' + err.message));
});
});
}
};
cacheTask.fileCache = fileCache;
module.exports = cacheTask; | 'use strict';
var _ = require('lodash-node'),
es = require('event-stream'),
PluginError = require('gulp-util').PluginError,
Cache = require('cache-swap'),
TaskProxy = require('./lib/TaskProxy');
var fileCache = new Cache({
cacheDirName: 'gulp-cache'
});
var defaultOptions = {
fileCache: fileCache,
key: _.noop,
success: _.noop,
value: _.noop
};
var cacheTask = {
proxy: function (name, opts) {
// Check if name was not passed, use default
if (_.isObject(name)) {
opts = name;
name = 'default';
}
var self = this;
// Make sure we have some sane defaults
opts = _.defaults(opts || {}, defaultOptions);
// Check for required task option
if (!opts.task) {
throw new PluginError('gulp-cache', 'Must pass a task to ' + name + ' cache.proxy');
}
// Pass through the file and cb to _processFile along with the opts
return es.map(function (file, cb) {
var taskProxy = new TaskProxy({
name: name,
file: file,
opts: opts
});
taskProxy.processFile().then(function (result) {
cb(null, result);
}).catch(function (err) {
cb(new PluginError('gulp-cache', err));
});
});
}
};
cacheTask.fileCache = fileCache;
module.exports = cacheTask; | Fix error to pass through | Fix error to pass through
| JavaScript | mit | jgable/gulp-cache | javascript | ## Code Before:
'use strict';
var _ = require('lodash-node'),
es = require('event-stream'),
PluginError = require('gulp-util').PluginError,
Cache = require('cache-swap'),
TaskProxy = require('./lib/TaskProxy');
var fileCache = new Cache({
cacheDirName: 'gulp-cache'
});
var defaultOptions = {
fileCache: fileCache,
key: _.noop,
success: _.noop,
value: _.noop
};
var cacheTask = {
proxy: function (name, opts) {
// Check if name was not passed, use default
if (_.isObject(name)) {
opts = name;
name = 'default';
}
var self = this;
// Make sure we have some sane defaults
opts = _.defaults(opts || {}, defaultOptions);
// Check for required task option
if (!opts.task) {
throw new PluginError('gulp-cache', 'Must pass a task to ' + name + ' cache.proxy');
}
// Pass through the file and cb to _processFile along with the opts
return es.map(function (file, cb) {
var taskProxy = new TaskProxy({
name: name,
file: file,
opts: opts
});
taskProxy.processFile().then(function (result) {
cb(null, result);
}).catch(function (err) {
cb(new PluginError('gulp-cache', 'Error proxying task ' + self.name + ': ' + err.message));
});
});
}
};
cacheTask.fileCache = fileCache;
module.exports = cacheTask;
## Instruction:
Fix error to pass through
## Code After:
'use strict';
var _ = require('lodash-node'),
es = require('event-stream'),
PluginError = require('gulp-util').PluginError,
Cache = require('cache-swap'),
TaskProxy = require('./lib/TaskProxy');
var fileCache = new Cache({
cacheDirName: 'gulp-cache'
});
var defaultOptions = {
fileCache: fileCache,
key: _.noop,
success: _.noop,
value: _.noop
};
var cacheTask = {
proxy: function (name, opts) {
// Check if name was not passed, use default
if (_.isObject(name)) {
opts = name;
name = 'default';
}
var self = this;
// Make sure we have some sane defaults
opts = _.defaults(opts || {}, defaultOptions);
// Check for required task option
if (!opts.task) {
throw new PluginError('gulp-cache', 'Must pass a task to ' + name + ' cache.proxy');
}
// Pass through the file and cb to _processFile along with the opts
return es.map(function (file, cb) {
var taskProxy = new TaskProxy({
name: name,
file: file,
opts: opts
});
taskProxy.processFile().then(function (result) {
cb(null, result);
}).catch(function (err) {
cb(new PluginError('gulp-cache', err));
});
});
}
};
cacheTask.fileCache = fileCache;
module.exports = cacheTask; | 'use strict';
var _ = require('lodash-node'),
es = require('event-stream'),
PluginError = require('gulp-util').PluginError,
Cache = require('cache-swap'),
TaskProxy = require('./lib/TaskProxy');
var fileCache = new Cache({
cacheDirName: 'gulp-cache'
});
var defaultOptions = {
fileCache: fileCache,
key: _.noop,
success: _.noop,
value: _.noop
};
var cacheTask = {
proxy: function (name, opts) {
// Check if name was not passed, use default
if (_.isObject(name)) {
opts = name;
name = 'default';
}
var self = this;
// Make sure we have some sane defaults
opts = _.defaults(opts || {}, defaultOptions);
// Check for required task option
if (!opts.task) {
throw new PluginError('gulp-cache', 'Must pass a task to ' + name + ' cache.proxy');
}
// Pass through the file and cb to _processFile along with the opts
return es.map(function (file, cb) {
var taskProxy = new TaskProxy({
name: name,
file: file,
opts: opts
});
taskProxy.processFile().then(function (result) {
cb(null, result);
}).catch(function (err) {
- cb(new PluginError('gulp-cache', 'Error proxying task ' + self.name + ': ' + err.message));
+ cb(new PluginError('gulp-cache', err));
});
});
}
};
cacheTask.fileCache = fileCache;
module.exports = cacheTask; | 2 | 0.035088 | 1 | 1 |
13e0341b0cfa395599194d66e7bb912204d7c108 | docroot/index.html | docroot/index.html | <!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>Hello world!</title>
</head>
<body>
<p>I'm going to be Agile California!</p>
</body>
</html>
| <!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>Hello world!</title>
</head>
<body>
<p>Put Agile California here!</p>
</body>
</html>
| Test deploy of changed content. | Test deploy of changed content.
| HTML | mit | hrod/agile-california,hrod/agile-california,hrod/agile-california,hrod/agile-california | html | ## Code Before:
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>Hello world!</title>
</head>
<body>
<p>I'm going to be Agile California!</p>
</body>
</html>
## Instruction:
Test deploy of changed content.
## Code After:
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>Hello world!</title>
</head>
<body>
<p>Put Agile California here!</p>
</body>
</html>
| <!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>Hello world!</title>
</head>
<body>
- <p>I'm going to be Agile California!</p>
+ <p>Put Agile California here!</p>
</body>
</html> | 2 | 0.2 | 1 | 1 |
5c0d03c9f8ae89c71da142c9b6a2731e969d9d98 | salt/migration/redef_load_example_data.sls | salt/migration/redef_load_example_data.sls | include:
- migration.reset
- migration.issuing_rules_imported
- migration.authorised_values_imported
- migration.patrons_imported
- migration.material_type_loaded
- migration.redef_catalogue_loaded
- migration.loans_loaded
- migration.reservations_loaded
- koha.reindexed
- migration.report
| include:
- migration.reset
- migration.issuing_rules_imported
- migration.authorised_values_imported
- migration.patrons_imported
- migration.material_type_loaded
- migration.redef_catalogue_loaded
- migration.loans_loaded
- migration.reservations_loaded
- koha.reindexed
- migration.redef_sparql_aggregation
- migration.redef_index_all_works
- migration.report
| Add sparql work aggregation and index to migration | Add sparql work aggregation and index to migration
| SaltStack | mit | digibib/ls.ext,digibib/ls.ext,digibib/ls.ext,digibib/ls.ext | saltstack | ## Code Before:
include:
- migration.reset
- migration.issuing_rules_imported
- migration.authorised_values_imported
- migration.patrons_imported
- migration.material_type_loaded
- migration.redef_catalogue_loaded
- migration.loans_loaded
- migration.reservations_loaded
- koha.reindexed
- migration.report
## Instruction:
Add sparql work aggregation and index to migration
## Code After:
include:
- migration.reset
- migration.issuing_rules_imported
- migration.authorised_values_imported
- migration.patrons_imported
- migration.material_type_loaded
- migration.redef_catalogue_loaded
- migration.loans_loaded
- migration.reservations_loaded
- koha.reindexed
- migration.redef_sparql_aggregation
- migration.redef_index_all_works
- migration.report
| include:
- migration.reset
- migration.issuing_rules_imported
- migration.authorised_values_imported
- migration.patrons_imported
- migration.material_type_loaded
- migration.redef_catalogue_loaded
- migration.loans_loaded
- migration.reservations_loaded
- koha.reindexed
+ - migration.redef_sparql_aggregation
+ - migration.redef_index_all_works
- migration.report | 2 | 0.181818 | 2 | 0 |
2b4303acfe63eb49b66486af1da150cfa4e3def3 | .travis.yml | .travis.yml | language: ruby
script : script/cibuild
sudo: false
notifications:
email: false
branches:
only:
- master
rvm:
- 2.4
- 2.3
- 2.2
- 2.1
env:
- ""
- JEKYLL_VERSION=3.4.4
matrix:
include:
- # GitHub Pages
rvm: 2.4.0
env: GH_PAGES=true
- # Ruby 1.9
rvm: 1.9
env: JEKYLL_VERSION=2.0
| language: ruby
script : script/cibuild
sudo: false
notifications:
email: false
branches:
only:
- master
rvm:
- 2.4
- 2.3
- 2.2
- 2.1
env:
- ""
- JEKYLL_VERSION=3.4.4
matrix:
include:
- # GitHub Pages
rvm: 2.4.0
env: GH_PAGES=true
| Remove Ruby 1.9 from test matrix. | Remove Ruby 1.9 from test matrix.
For real?
| YAML | mit | jekyll/jekyll-gist,jekyll/jekyll-gist | yaml | ## Code Before:
language: ruby
script : script/cibuild
sudo: false
notifications:
email: false
branches:
only:
- master
rvm:
- 2.4
- 2.3
- 2.2
- 2.1
env:
- ""
- JEKYLL_VERSION=3.4.4
matrix:
include:
- # GitHub Pages
rvm: 2.4.0
env: GH_PAGES=true
- # Ruby 1.9
rvm: 1.9
env: JEKYLL_VERSION=2.0
## Instruction:
Remove Ruby 1.9 from test matrix.
For real?
## Code After:
language: ruby
script : script/cibuild
sudo: false
notifications:
email: false
branches:
only:
- master
rvm:
- 2.4
- 2.3
- 2.2
- 2.1
env:
- ""
- JEKYLL_VERSION=3.4.4
matrix:
include:
- # GitHub Pages
rvm: 2.4.0
env: GH_PAGES=true
| language: ruby
script : script/cibuild
sudo: false
notifications:
email: false
branches:
only:
- master
rvm:
- 2.4
- 2.3
- 2.2
- 2.1
env:
- ""
- JEKYLL_VERSION=3.4.4
matrix:
include:
- # GitHub Pages
rvm: 2.4.0
env: GH_PAGES=true
- - # Ruby 1.9
- rvm: 1.9
- env: JEKYLL_VERSION=2.0 | 3 | 0.12 | 0 | 3 |
e34bf88146b5e47cb44b588d6c84d2ca80555e56 | scripts/github-ci-test.sh | scripts/github-ci-test.sh |
xcodebuild -workspace Hammerspoon.xcworkspace -scheme Release test-without-building 2>&1 | tee test.log
RESULT=$(cat test.log | grep -A1 "Test Suite 'All tests'" | tail -1)
echo "::set-output name=test_result::${RESULT}"
if [[ "${RESULT}" == *"0 failures"* ]]; then
echo "::set-output name=test_result_short::Passed"
exit 0
else
echo "::set-output name=test_result_short::Failed"
exit 1
fi
|
xcodebuild -workspace Hammerspoon.xcworkspace -scheme Release test-without-building 2>&1 | tee test.log
RESULT=$(grep -A1 "Test Suite 'All tests'" test.log | tail -1 | sed -e 's/^[ ]+//')
echo "::set-output name=test_result::${RESULT}"
if [[ "${RESULT}" == *"0 failures"* ]]; then
echo "::set-output name=test_result_short::Passed"
exit 0
else
echo "::set-output name=test_result_short::Failed"
exit 1
fi
| Tidy up the test output in IRC notifications a little | Tidy up the test output in IRC notifications a little
| Shell | mit | asmagill/hammerspoon,asmagill/hammerspoon,Habbie/hammerspoon,CommandPost/CommandPost-App,CommandPost/CommandPost-App,cmsj/hammerspoon,latenitefilms/hammerspoon,cmsj/hammerspoon,latenitefilms/hammerspoon,asmagill/hammerspoon,cmsj/hammerspoon,asmagill/hammerspoon,asmagill/hammerspoon,Hammerspoon/hammerspoon,Hammerspoon/hammerspoon,Hammerspoon/hammerspoon,Hammerspoon/hammerspoon,Habbie/hammerspoon,CommandPost/CommandPost-App,Hammerspoon/hammerspoon,Habbie/hammerspoon,Habbie/hammerspoon,latenitefilms/hammerspoon,Habbie/hammerspoon,CommandPost/CommandPost-App,CommandPost/CommandPost-App,latenitefilms/hammerspoon,asmagill/hammerspoon,cmsj/hammerspoon,cmsj/hammerspoon,cmsj/hammerspoon,latenitefilms/hammerspoon,Hammerspoon/hammerspoon,Habbie/hammerspoon,CommandPost/CommandPost-App,latenitefilms/hammerspoon | shell | ## Code Before:
xcodebuild -workspace Hammerspoon.xcworkspace -scheme Release test-without-building 2>&1 | tee test.log
RESULT=$(cat test.log | grep -A1 "Test Suite 'All tests'" | tail -1)
echo "::set-output name=test_result::${RESULT}"
if [[ "${RESULT}" == *"0 failures"* ]]; then
echo "::set-output name=test_result_short::Passed"
exit 0
else
echo "::set-output name=test_result_short::Failed"
exit 1
fi
## Instruction:
Tidy up the test output in IRC notifications a little
## Code After:
xcodebuild -workspace Hammerspoon.xcworkspace -scheme Release test-without-building 2>&1 | tee test.log
RESULT=$(grep -A1 "Test Suite 'All tests'" test.log | tail -1 | sed -e 's/^[ ]+//')
echo "::set-output name=test_result::${RESULT}"
if [[ "${RESULT}" == *"0 failures"* ]]; then
echo "::set-output name=test_result_short::Passed"
exit 0
else
echo "::set-output name=test_result_short::Failed"
exit 1
fi
|
xcodebuild -workspace Hammerspoon.xcworkspace -scheme Release test-without-building 2>&1 | tee test.log
- RESULT=$(cat test.log | grep -A1 "Test Suite 'All tests'" | tail -1)
+ RESULT=$(grep -A1 "Test Suite 'All tests'" test.log | tail -1 | sed -e 's/^[ ]+//')
echo "::set-output name=test_result::${RESULT}"
if [[ "${RESULT}" == *"0 failures"* ]]; then
echo "::set-output name=test_result_short::Passed"
exit 0
else
echo "::set-output name=test_result_short::Failed"
exit 1
fi | 2 | 0.142857 | 1 | 1 |
250b2d3c48fdb2d58613dd1a4ef52ce8f7ed066e | Cargo.toml | Cargo.toml | [package]
name = "tokio-serial"
version = "3.1.0"
authors = ["Zac Berkowitz <zac.berkowitz@gmail.com>"]
description = "A serial port implementation for tokio"
license = "MIT"
homepage = "https://github.com/berkowski/tokio-serial"
repository = "https://github.com/berkowski/tokio-serial"
documentation = "http://docs.rs/tokio-serial"
readme = "README.md"
keywords = ["rs232", "serial", "tokio"]
categories = ["asynchronous", "hardware-support"]
[badges]
appveyor = { repository = "berkowski/tokio-serial", service = "github" }
travis-ci = { repository = "berkowski/tokio-serial", service = "github" }
[features]
default = ["libudev"]
libudev = ["mio-serial/libudev"]
[dependencies]
futures = "0.1"
tokio-io = "0.1"
tokio-reactor = "0.1"
bytes = "0.4"
mio = "0.6"
mio-serial = "=3.1"
[dev-dependencies]
tokio = "0.1"
| [package]
name = "tokio-serial"
version = "3.1.0"
authors = ["Zac Berkowitz <zac.berkowitz@gmail.com>"]
description = "A serial port implementation for tokio"
license = "MIT"
homepage = "https://github.com/berkowski/tokio-serial"
repository = "https://github.com/berkowski/tokio-serial"
documentation = "http://docs.rs/tokio-serial"
readme = "README.md"
keywords = ["rs232", "serial", "tokio"]
categories = ["asynchronous", "hardware-support"]
[badges]
appveyor = { repository = "berkowski/tokio-serial", service = "github" }
travis-ci = { repository = "berkowski/tokio-serial", service = "github" }
[features]
default = ["libudev"]
libudev = ["mio-serial/libudev"]
[dependencies]
futures = "0.1"
tokio-io = "0.1"
tokio-reactor = "0.1"
bytes = "0.4"
mio = "0.6"
mio-serial = { version = "=3.1", default-features = false }
[dev-dependencies]
tokio = "0.1"
| Fix feature flag to not mandatory require libudev | Fix feature flag to not mandatory require libudev
Before, the mio-serial/default feature wasn't turned off even if the default
feature of the tokio-serial was off. We need to deselect the mio-serial/default
explicitly, and turn it on by the default of the tokio-serial.
| TOML | mit | berkowski/tokio-serial | toml | ## Code Before:
[package]
name = "tokio-serial"
version = "3.1.0"
authors = ["Zac Berkowitz <zac.berkowitz@gmail.com>"]
description = "A serial port implementation for tokio"
license = "MIT"
homepage = "https://github.com/berkowski/tokio-serial"
repository = "https://github.com/berkowski/tokio-serial"
documentation = "http://docs.rs/tokio-serial"
readme = "README.md"
keywords = ["rs232", "serial", "tokio"]
categories = ["asynchronous", "hardware-support"]
[badges]
appveyor = { repository = "berkowski/tokio-serial", service = "github" }
travis-ci = { repository = "berkowski/tokio-serial", service = "github" }
[features]
default = ["libudev"]
libudev = ["mio-serial/libudev"]
[dependencies]
futures = "0.1"
tokio-io = "0.1"
tokio-reactor = "0.1"
bytes = "0.4"
mio = "0.6"
mio-serial = "=3.1"
[dev-dependencies]
tokio = "0.1"
## Instruction:
Fix feature flag to not mandatory require libudev
Before, the mio-serial/default feature wasn't turned off even if the default
feature of the tokio-serial was off. We need to deselect the mio-serial/default
explicitly, and turn it on by the default of the tokio-serial.
## Code After:
[package]
name = "tokio-serial"
version = "3.1.0"
authors = ["Zac Berkowitz <zac.berkowitz@gmail.com>"]
description = "A serial port implementation for tokio"
license = "MIT"
homepage = "https://github.com/berkowski/tokio-serial"
repository = "https://github.com/berkowski/tokio-serial"
documentation = "http://docs.rs/tokio-serial"
readme = "README.md"
keywords = ["rs232", "serial", "tokio"]
categories = ["asynchronous", "hardware-support"]
[badges]
appveyor = { repository = "berkowski/tokio-serial", service = "github" }
travis-ci = { repository = "berkowski/tokio-serial", service = "github" }
[features]
default = ["libudev"]
libudev = ["mio-serial/libudev"]
[dependencies]
futures = "0.1"
tokio-io = "0.1"
tokio-reactor = "0.1"
bytes = "0.4"
mio = "0.6"
mio-serial = { version = "=3.1", default-features = false }
[dev-dependencies]
tokio = "0.1"
| [package]
name = "tokio-serial"
version = "3.1.0"
authors = ["Zac Berkowitz <zac.berkowitz@gmail.com>"]
description = "A serial port implementation for tokio"
license = "MIT"
homepage = "https://github.com/berkowski/tokio-serial"
repository = "https://github.com/berkowski/tokio-serial"
documentation = "http://docs.rs/tokio-serial"
readme = "README.md"
keywords = ["rs232", "serial", "tokio"]
categories = ["asynchronous", "hardware-support"]
[badges]
appveyor = { repository = "berkowski/tokio-serial", service = "github" }
travis-ci = { repository = "berkowski/tokio-serial", service = "github" }
[features]
default = ["libudev"]
libudev = ["mio-serial/libudev"]
[dependencies]
futures = "0.1"
tokio-io = "0.1"
tokio-reactor = "0.1"
bytes = "0.4"
mio = "0.6"
- mio-serial = "=3.1"
+ mio-serial = { version = "=3.1", default-features = false }
[dev-dependencies]
tokio = "0.1" | 2 | 0.064516 | 1 | 1 |
a859bcd20b911d8b22b04ba1f5012a50329175c3 | lib/maglev-database-explorer/engine_symlinks.rb | lib/maglev-database-explorer/engine_symlinks.rb | create_public_link = "ln -sfT \"#{MaglevDatabaseExplorer.full_gem_path}/public\" \"#{Dir.getwd}/public/maglev-database-explorer\""
puts "Creating symlink: #{create_public_link}"
if not system(create_public_link)
puts "ERROR: Failed to create symbolic link to public directory of MagLev Database Explorer with '#{create_public_link}'."
exit
end
# Workaround for symlinks not working correctly on MagLev
create_views_link ="ln -sfT \"#{MaglevDatabaseExplorer.full_gem_path}/app/views/maglev_database_explorer\" \"#{Dir.getwd}/app/views/maglev_database_explorer\""
puts "Creating symlink: #{create_views_link}"
if not system(create_views_link)
puts "ERROR: Failed to create symbolic link to views directory of MagLev Database Explorer."
exit
end
| mkdir_public = "mkdir -p \"#{Dir.getwd}/public\""
system(mkdir_public)
create_public_link = "ln -sfT \"#{MaglevDatabaseExplorer.full_gem_path}/public\" \"#{Dir.getwd}/public/maglev-database-explorer\""
puts "Creating symlink: #{create_public_link}"
if not system(create_public_link)
puts "ERROR: Failed to create symbolic link to public directory of MagLev Database Explorer with '#{create_public_link}'."
exit
end
# Workaround for engine paths not working correctly on MagLev
create_views_link = "ln -sfT \"#{MaglevDatabaseExplorer.full_gem_path}/app/views/maglev_database_explorer\" \"#{Dir.getwd}/app/views/maglev_database_explorer\""
puts "Creating symlink: #{create_views_link}"
if not system(create_views_link)
puts "ERROR: Failed to create symbolic link to views directory of MagLev Database Explorer."
exit
end
| Create public directory if necessary. | Create public directory if necessary.
| Ruby | mit | matthias-springer/maglev-database-explorer-gem,matthias-springer/maglev-database-explorer-gem,matthias-springer/maglev-database-explorer-gem,matthias-springer/maglev-database-explorer-gem,matthias-springer/maglev-database-explorer-gem,matthias-springer/maglev-database-explorer-gem | ruby | ## Code Before:
create_public_link = "ln -sfT \"#{MaglevDatabaseExplorer.full_gem_path}/public\" \"#{Dir.getwd}/public/maglev-database-explorer\""
puts "Creating symlink: #{create_public_link}"
if not system(create_public_link)
puts "ERROR: Failed to create symbolic link to public directory of MagLev Database Explorer with '#{create_public_link}'."
exit
end
# Workaround for symlinks not working correctly on MagLev
create_views_link ="ln -sfT \"#{MaglevDatabaseExplorer.full_gem_path}/app/views/maglev_database_explorer\" \"#{Dir.getwd}/app/views/maglev_database_explorer\""
puts "Creating symlink: #{create_views_link}"
if not system(create_views_link)
puts "ERROR: Failed to create symbolic link to views directory of MagLev Database Explorer."
exit
end
## Instruction:
Create public directory if necessary.
## Code After:
mkdir_public = "mkdir -p \"#{Dir.getwd}/public\""
system(mkdir_public)
create_public_link = "ln -sfT \"#{MaglevDatabaseExplorer.full_gem_path}/public\" \"#{Dir.getwd}/public/maglev-database-explorer\""
puts "Creating symlink: #{create_public_link}"
if not system(create_public_link)
puts "ERROR: Failed to create symbolic link to public directory of MagLev Database Explorer with '#{create_public_link}'."
exit
end
# Workaround for engine paths not working correctly on MagLev
create_views_link = "ln -sfT \"#{MaglevDatabaseExplorer.full_gem_path}/app/views/maglev_database_explorer\" \"#{Dir.getwd}/app/views/maglev_database_explorer\""
puts "Creating symlink: #{create_views_link}"
if not system(create_views_link)
puts "ERROR: Failed to create symbolic link to views directory of MagLev Database Explorer."
exit
end
| + mkdir_public = "mkdir -p \"#{Dir.getwd}/public\""
+ system(mkdir_public)
+
create_public_link = "ln -sfT \"#{MaglevDatabaseExplorer.full_gem_path}/public\" \"#{Dir.getwd}/public/maglev-database-explorer\""
puts "Creating symlink: #{create_public_link}"
if not system(create_public_link)
puts "ERROR: Failed to create symbolic link to public directory of MagLev Database Explorer with '#{create_public_link}'."
exit
end
- # Workaround for symlinks not working correctly on MagLev
? ^^^^ ^
+ # Workaround for engine paths not working correctly on MagLev
? ^^^ ^^^^^^
- create_views_link ="ln -sfT \"#{MaglevDatabaseExplorer.full_gem_path}/app/views/maglev_database_explorer\" \"#{Dir.getwd}/app/views/maglev_database_explorer\""
+ create_views_link = "ln -sfT \"#{MaglevDatabaseExplorer.full_gem_path}/app/views/maglev_database_explorer\" \"#{Dir.getwd}/app/views/maglev_database_explorer\""
? +
puts "Creating symlink: #{create_views_link}"
if not system(create_views_link)
puts "ERROR: Failed to create symbolic link to views directory of MagLev Database Explorer."
exit
end
| 7 | 0.368421 | 5 | 2 |
ff86c57864c82a30f9af6bea2b29b8b2ae68defd | server/routes/heroku.js | server/routes/heroku.js | var express = require('express');
var router = express.Router();
var request = require('request');
router.get('/', function(req, res) {
request({
url: 'https://status.heroku.com/api/v3/current-status',
method: 'GET'
}, function(err, res, body) {
console.log(body);
res.sendStatus(200).end();
});
});
module.exports = router;
| var express = require('express');
var router = express.Router();
var request = require('request');
router.get('/', function(req, res) {
request({
url: 'https://status.heroku.com/api/v3/current-status',
method: 'GET'
}, function(error, response, body) {
console.log(body); // {"status":{"Production":"green","Development":"green"},"issues":[]}
res.sendStatus(200).end();
});
});
module.exports = router;
| Rename res to not overwrite express res. | Rename res to not overwrite express res.
| JavaScript | mit | jontewks/bc-slack-alerts | javascript | ## Code Before:
var express = require('express');
var router = express.Router();
var request = require('request');
router.get('/', function(req, res) {
request({
url: 'https://status.heroku.com/api/v3/current-status',
method: 'GET'
}, function(err, res, body) {
console.log(body);
res.sendStatus(200).end();
});
});
module.exports = router;
## Instruction:
Rename res to not overwrite express res.
## Code After:
var express = require('express');
var router = express.Router();
var request = require('request');
router.get('/', function(req, res) {
request({
url: 'https://status.heroku.com/api/v3/current-status',
method: 'GET'
}, function(error, response, body) {
console.log(body); // {"status":{"Production":"green","Development":"green"},"issues":[]}
res.sendStatus(200).end();
});
});
module.exports = router;
| var express = require('express');
var router = express.Router();
var request = require('request');
router.get('/', function(req, res) {
request({
url: 'https://status.heroku.com/api/v3/current-status',
method: 'GET'
- }, function(err, res, body) {
+ }, function(error, response, body) {
? ++ +++++
- console.log(body);
+ console.log(body); // {"status":{"Production":"green","Development":"green"},"issues":[]}
res.sendStatus(200).end();
});
});
module.exports = router; | 4 | 0.266667 | 2 | 2 |
78f5d4a0162a3e65cc1c72265fc7f918f36baff3 | html/templates/libraries.html | html/templates/libraries.html | <h2>Library</h2>
<div class="tabs" data-bind="foreach: LibraryTabs">
<span data-bind="click: $parent.SelectedTab, css: $parent.TabClassName($data), text: Name"></span>
</div>
<div class="library" data-bind="component: { name: SelectedTab().Component, params: { tracker: Tracker, encounterCommander: EncounterCommander, library: SelectedTab().Library } }"></div>
| <h2>Library</h2>
<div class="close button fa fa-close" data-bind="click: EncounterCommander.HideLibraries"></div>
<div class="tabs" data-bind="foreach: LibraryTabs">
<span data-bind="click: $parent.SelectedTab, css: $parent.TabClassName($data), text: Name"></span>
</div>
<div class="library" data-bind="component: { name: SelectedTab().Component, params: { tracker: Tracker, encounterCommander: EncounterCommander, library: SelectedTab().Library } }"></div>
| Add close button to Library corner | Add close button to Library corner
| HTML | mit | cynicaloptimist/improved-initiative,cynicaloptimist/improved-initiative,cynicaloptimist/improved-initiative | html | ## Code Before:
<h2>Library</h2>
<div class="tabs" data-bind="foreach: LibraryTabs">
<span data-bind="click: $parent.SelectedTab, css: $parent.TabClassName($data), text: Name"></span>
</div>
<div class="library" data-bind="component: { name: SelectedTab().Component, params: { tracker: Tracker, encounterCommander: EncounterCommander, library: SelectedTab().Library } }"></div>
## Instruction:
Add close button to Library corner
## Code After:
<h2>Library</h2>
<div class="close button fa fa-close" data-bind="click: EncounterCommander.HideLibraries"></div>
<div class="tabs" data-bind="foreach: LibraryTabs">
<span data-bind="click: $parent.SelectedTab, css: $parent.TabClassName($data), text: Name"></span>
</div>
<div class="library" data-bind="component: { name: SelectedTab().Component, params: { tracker: Tracker, encounterCommander: EncounterCommander, library: SelectedTab().Library } }"></div>
| <h2>Library</h2>
+ <div class="close button fa fa-close" data-bind="click: EncounterCommander.HideLibraries"></div>
<div class="tabs" data-bind="foreach: LibraryTabs">
<span data-bind="click: $parent.SelectedTab, css: $parent.TabClassName($data), text: Name"></span>
</div>
<div class="library" data-bind="component: { name: SelectedTab().Component, params: { tracker: Tracker, encounterCommander: EncounterCommander, library: SelectedTab().Library } }"></div> | 1 | 0.2 | 1 | 0 |
e57e13bde61a233b18504ab1617c6ecabad20fc3 | setup.py | setup.py |
from setuptools import setup
from setuptools import find_packages
import re
def find_version():
return re.search(r"^__version__ = '(.*)'$",
open('cantools/version.py', 'r').read(),
re.MULTILINE).group(1)
setup(name='cantools',
version=find_version(),
description='CAN BUS tools.',
long_description=open('README.rst', 'r').read(),
author='Erik Moqvist',
author_email='erik.moqvist@gmail.com',
license='MIT',
classifiers=[
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
keywords=['can', 'can bus', 'dbc', 'kcd', 'automotive'],
url='https://github.com/eerimoq/cantools',
packages=find_packages(exclude=['tests']),
python_requires='>=3.6',
install_requires=[
'bitstruct>=6.0.0',
'python-can>=2.2.0',
'textparser>=0.21.1',
'diskcache',
'argparse_addons',
],
test_suite="tests",
entry_points = {
'console_scripts': ['cantools=cantools.__init__:_main']
})
|
from setuptools import setup
from setuptools import find_packages
import re
def find_version():
return re.search(r"^__version__ = '(.*)'$",
open('cantools/version.py', 'r').read(),
re.MULTILINE).group(1)
setup(name='cantools',
version=find_version(),
description='CAN BUS tools.',
long_description=open('README.rst', 'r').read(),
author='Erik Moqvist',
author_email='erik.moqvist@gmail.com',
license='MIT',
classifiers=[
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
],
keywords=['can', 'can bus', 'dbc', 'kcd', 'automotive'],
url='https://github.com/eerimoq/cantools',
packages=find_packages(exclude=['tests']),
python_requires='>=3.6',
install_requires=[
'bitstruct>=6.0.0',
'python-can>=2.2.0',
'textparser>=0.21.1',
'diskcache',
'argparse_addons',
],
test_suite="tests",
entry_points = {
'console_scripts': ['cantools=cantools.__init__:_main']
})
| Remove per patch version classifiers | Remove per patch version classifiers | Python | mit | eerimoq/cantools,cantools/cantools | python | ## Code Before:
from setuptools import setup
from setuptools import find_packages
import re
def find_version():
return re.search(r"^__version__ = '(.*)'$",
open('cantools/version.py', 'r').read(),
re.MULTILINE).group(1)
setup(name='cantools',
version=find_version(),
description='CAN BUS tools.',
long_description=open('README.rst', 'r').read(),
author='Erik Moqvist',
author_email='erik.moqvist@gmail.com',
license='MIT',
classifiers=[
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
keywords=['can', 'can bus', 'dbc', 'kcd', 'automotive'],
url='https://github.com/eerimoq/cantools',
packages=find_packages(exclude=['tests']),
python_requires='>=3.6',
install_requires=[
'bitstruct>=6.0.0',
'python-can>=2.2.0',
'textparser>=0.21.1',
'diskcache',
'argparse_addons',
],
test_suite="tests",
entry_points = {
'console_scripts': ['cantools=cantools.__init__:_main']
})
## Instruction:
Remove per patch version classifiers
## Code After:
from setuptools import setup
from setuptools import find_packages
import re
def find_version():
return re.search(r"^__version__ = '(.*)'$",
open('cantools/version.py', 'r').read(),
re.MULTILINE).group(1)
setup(name='cantools',
version=find_version(),
description='CAN BUS tools.',
long_description=open('README.rst', 'r').read(),
author='Erik Moqvist',
author_email='erik.moqvist@gmail.com',
license='MIT',
classifiers=[
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
],
keywords=['can', 'can bus', 'dbc', 'kcd', 'automotive'],
url='https://github.com/eerimoq/cantools',
packages=find_packages(exclude=['tests']),
python_requires='>=3.6',
install_requires=[
'bitstruct>=6.0.0',
'python-can>=2.2.0',
'textparser>=0.21.1',
'diskcache',
'argparse_addons',
],
test_suite="tests",
entry_points = {
'console_scripts': ['cantools=cantools.__init__:_main']
})
|
from setuptools import setup
from setuptools import find_packages
import re
def find_version():
return re.search(r"^__version__ = '(.*)'$",
open('cantools/version.py', 'r').read(),
re.MULTILINE).group(1)
setup(name='cantools',
version=find_version(),
description='CAN BUS tools.',
long_description=open('README.rst', 'r').read(),
author='Erik Moqvist',
author_email='erik.moqvist@gmail.com',
license='MIT',
classifiers=[
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
- 'Programming Language :: Python :: 3.6',
- 'Programming Language :: Python :: 3.7',
- 'Programming Language :: Python :: 3.8',
- 'Programming Language :: Python :: 3.9',
],
keywords=['can', 'can bus', 'dbc', 'kcd', 'automotive'],
url='https://github.com/eerimoq/cantools',
packages=find_packages(exclude=['tests']),
python_requires='>=3.6',
install_requires=[
'bitstruct>=6.0.0',
'python-can>=2.2.0',
'textparser>=0.21.1',
'diskcache',
'argparse_addons',
],
test_suite="tests",
entry_points = {
'console_scripts': ['cantools=cantools.__init__:_main']
}) | 4 | 0.093023 | 0 | 4 |
1784b0d35c16a79fc39d84e1eb4a3876041763f6 | .rubocop.yml | .rubocop.yml | require: rubocop-rspec
inherit_mode:
merge:
- Exclude
AllCops:
TargetRubyVersion: 2.4
DisplayCopNames: true
Exclude:
- 'lib/generators/enumerate_it/enum/templates/**/*'
- 'gemfiles/vendor/**/*'
Gemspec/RequiredRubyVersion:
Enabled: false
Layout/EndAlignment:
Enabled: false
Layout/LineLength:
Max: 100
Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true
Metrics/BlockLength:
Exclude:
- 'spec/**/*'
Layout/HashAlignment:
EnforcedColonStyle: table
EnforcedLastArgumentHashStyle: ignore_implicit
Layout/ElseAlignment:
Enabled: false
Layout/IndentationWidth:
Enabled: false
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Style/FrozenStringLiteralComment:
Enabled: false
Style/Documentation:
Enabled: false
Style/GuardClause:
MinBodyLength: 3
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
Naming/PredicateName:
Exclude:
- 'lib/enumerate_it/class_methods.rb'
Naming/VariableNumber:
EnforcedStyle: snake_case
RSpec/MultipleExpectations:
Enabled: false
RSpec/NestedGroups:
Enabled: false
RSpec/MessageExpectation:
Enabled: false
RSpec/MessageSpies:
Enabled: false
RSpec/ContextWording:
Enabled: false
| require: rubocop-rspec
inherit_mode:
merge:
- Exclude
AllCops:
NewCops: enable
TargetRubyVersion: 2.4
Exclude:
- 'lib/generators/enumerate_it/enum/templates/**/*'
- 'gemfiles/vendor/**/*'
Gemspec/RequiredRubyVersion:
Enabled: false
Layout/EndAlignment:
Enabled: false
Layout/LineLength:
Max: 100
Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true
Metrics/BlockLength:
Exclude:
- 'spec/**/*'
Layout/HashAlignment:
EnforcedColonStyle: table
EnforcedLastArgumentHashStyle: ignore_implicit
Layout/ElseAlignment:
Enabled: false
Layout/IndentationWidth:
Enabled: false
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Style/FrozenStringLiteralComment:
Enabled: false
Style/Documentation:
Enabled: false
Style/GuardClause:
MinBodyLength: 3
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
Naming/PredicateName:
Exclude:
- 'lib/enumerate_it/class_methods.rb'
Naming/VariableNumber:
EnforcedStyle: snake_case
RSpec/MultipleExpectations:
Enabled: false
RSpec/NestedGroups:
Enabled: false
RSpec/MessageExpectation:
Enabled: false
RSpec/MessageSpies:
Enabled: false
RSpec/ContextWording:
Enabled: false
| Enable all new Rubocop cops by default | Enable all new Rubocop cops by default | YAML | mit | cassiomarques/enumerate_it | yaml | ## Code Before:
require: rubocop-rspec
inherit_mode:
merge:
- Exclude
AllCops:
TargetRubyVersion: 2.4
DisplayCopNames: true
Exclude:
- 'lib/generators/enumerate_it/enum/templates/**/*'
- 'gemfiles/vendor/**/*'
Gemspec/RequiredRubyVersion:
Enabled: false
Layout/EndAlignment:
Enabled: false
Layout/LineLength:
Max: 100
Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true
Metrics/BlockLength:
Exclude:
- 'spec/**/*'
Layout/HashAlignment:
EnforcedColonStyle: table
EnforcedLastArgumentHashStyle: ignore_implicit
Layout/ElseAlignment:
Enabled: false
Layout/IndentationWidth:
Enabled: false
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Style/FrozenStringLiteralComment:
Enabled: false
Style/Documentation:
Enabled: false
Style/GuardClause:
MinBodyLength: 3
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
Naming/PredicateName:
Exclude:
- 'lib/enumerate_it/class_methods.rb'
Naming/VariableNumber:
EnforcedStyle: snake_case
RSpec/MultipleExpectations:
Enabled: false
RSpec/NestedGroups:
Enabled: false
RSpec/MessageExpectation:
Enabled: false
RSpec/MessageSpies:
Enabled: false
RSpec/ContextWording:
Enabled: false
## Instruction:
Enable all new Rubocop cops by default
## Code After:
require: rubocop-rspec
inherit_mode:
merge:
- Exclude
AllCops:
NewCops: enable
TargetRubyVersion: 2.4
Exclude:
- 'lib/generators/enumerate_it/enum/templates/**/*'
- 'gemfiles/vendor/**/*'
Gemspec/RequiredRubyVersion:
Enabled: false
Layout/EndAlignment:
Enabled: false
Layout/LineLength:
Max: 100
Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true
Metrics/BlockLength:
Exclude:
- 'spec/**/*'
Layout/HashAlignment:
EnforcedColonStyle: table
EnforcedLastArgumentHashStyle: ignore_implicit
Layout/ElseAlignment:
Enabled: false
Layout/IndentationWidth:
Enabled: false
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Style/FrozenStringLiteralComment:
Enabled: false
Style/Documentation:
Enabled: false
Style/GuardClause:
MinBodyLength: 3
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
Naming/PredicateName:
Exclude:
- 'lib/enumerate_it/class_methods.rb'
Naming/VariableNumber:
EnforcedStyle: snake_case
RSpec/MultipleExpectations:
Enabled: false
RSpec/NestedGroups:
Enabled: false
RSpec/MessageExpectation:
Enabled: false
RSpec/MessageSpies:
Enabled: false
RSpec/ContextWording:
Enabled: false
| require: rubocop-rspec
inherit_mode:
merge:
- Exclude
AllCops:
+ NewCops: enable
TargetRubyVersion: 2.4
- DisplayCopNames: true
Exclude:
- 'lib/generators/enumerate_it/enum/templates/**/*'
- 'gemfiles/vendor/**/*'
Gemspec/RequiredRubyVersion:
Enabled: false
Layout/EndAlignment:
Enabled: false
Layout/LineLength:
Max: 100
Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true
Metrics/BlockLength:
Exclude:
- 'spec/**/*'
Layout/HashAlignment:
EnforcedColonStyle: table
EnforcedLastArgumentHashStyle: ignore_implicit
Layout/ElseAlignment:
Enabled: false
Layout/IndentationWidth:
Enabled: false
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Style/FrozenStringLiteralComment:
Enabled: false
Style/Documentation:
Enabled: false
Style/GuardClause:
MinBodyLength: 3
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
Naming/PredicateName:
Exclude:
- 'lib/enumerate_it/class_methods.rb'
Naming/VariableNumber:
EnforcedStyle: snake_case
RSpec/MultipleExpectations:
Enabled: false
RSpec/NestedGroups:
Enabled: false
RSpec/MessageExpectation:
Enabled: false
RSpec/MessageSpies:
Enabled: false
RSpec/ContextWording:
Enabled: false | 2 | 0.023529 | 1 | 1 |
36dfba6a30405b584b1e0a1de2d6dcf0285aef4d | app/assets/javascripts/agreement.js | app/assets/javascripts/agreement.js | /* jslint browser: true */
/* global $ */
(function(){
var makeCloneable = function(selector) {
var scope = $(selector);
var update_remove_one_visibility = function() {
var hidden = scope.find('.cloneable').length < 2;
scope.find('.remove-one').toggleClass('hidden', hidden);
};
update_remove_one_visibility();
scope.find('.add-one').click(function(e) {
e.preventDefault();
var newContent = scope.find('.cloneable:first').clone();
scope.find('.cloneable:last').after(newContent);
scope.find('.cloneable:last input[type="text"]').val('');
update_remove_one_visibility();
});
scope.find('.remove-one').click(function(e) {
e.preventDefault();
scope.find('.cloneable:last').remove();
update_remove_one_visibility();
});
};
$(document).ready(function() {
makeCloneable('#budgetary-responsibilities');
});
})();
| /* jslint browser: true */
/* global $ */
(function(){
var makeCloneable = function(selector) {
var scope = $(selector);
var update_remove_one_visibility = function() {
var hidden = scope.find('.cloneable').length < 2;
scope.find('.remove-one').toggleClass('hidden', hidden);
};
update_remove_one_visibility();
scope.find('.add-one').click(function(e) {
e.preventDefault();
var newContent = scope.find('.cloneable:first').clone();
scope.find('.cloneable:last').after(newContent);
scope.find('.cloneable:last input[type="text"]').val('');
scope.find('.cloneable:last textarea').text('');
update_remove_one_visibility();
});
scope.find('.remove-one').click(function(e) {
e.preventDefault();
scope.find('.cloneable:last').remove();
update_remove_one_visibility();
});
};
$(document).ready(function() {
makeCloneable('#budgetary-responsibilities');
});
})();
| Clear textarea in cloned row | Clear textarea in cloned row
| JavaScript | mit | ministryofjustice/scs_appraisals,ministryofjustice/scs_appraisals,ministryofjustice/scs_appraisals | javascript | ## Code Before:
/* jslint browser: true */
/* global $ */
(function(){
var makeCloneable = function(selector) {
var scope = $(selector);
var update_remove_one_visibility = function() {
var hidden = scope.find('.cloneable').length < 2;
scope.find('.remove-one').toggleClass('hidden', hidden);
};
update_remove_one_visibility();
scope.find('.add-one').click(function(e) {
e.preventDefault();
var newContent = scope.find('.cloneable:first').clone();
scope.find('.cloneable:last').after(newContent);
scope.find('.cloneable:last input[type="text"]').val('');
update_remove_one_visibility();
});
scope.find('.remove-one').click(function(e) {
e.preventDefault();
scope.find('.cloneable:last').remove();
update_remove_one_visibility();
});
};
$(document).ready(function() {
makeCloneable('#budgetary-responsibilities');
});
})();
## Instruction:
Clear textarea in cloned row
## Code After:
/* jslint browser: true */
/* global $ */
(function(){
var makeCloneable = function(selector) {
var scope = $(selector);
var update_remove_one_visibility = function() {
var hidden = scope.find('.cloneable').length < 2;
scope.find('.remove-one').toggleClass('hidden', hidden);
};
update_remove_one_visibility();
scope.find('.add-one').click(function(e) {
e.preventDefault();
var newContent = scope.find('.cloneable:first').clone();
scope.find('.cloneable:last').after(newContent);
scope.find('.cloneable:last input[type="text"]').val('');
scope.find('.cloneable:last textarea').text('');
update_remove_one_visibility();
});
scope.find('.remove-one').click(function(e) {
e.preventDefault();
scope.find('.cloneable:last').remove();
update_remove_one_visibility();
});
};
$(document).ready(function() {
makeCloneable('#budgetary-responsibilities');
});
})();
| /* jslint browser: true */
/* global $ */
(function(){
var makeCloneable = function(selector) {
var scope = $(selector);
var update_remove_one_visibility = function() {
var hidden = scope.find('.cloneable').length < 2;
scope.find('.remove-one').toggleClass('hidden', hidden);
};
update_remove_one_visibility();
scope.find('.add-one').click(function(e) {
e.preventDefault();
var newContent = scope.find('.cloneable:first').clone();
scope.find('.cloneable:last').after(newContent);
scope.find('.cloneable:last input[type="text"]').val('');
+ scope.find('.cloneable:last textarea').text('');
update_remove_one_visibility();
});
scope.find('.remove-one').click(function(e) {
e.preventDefault();
scope.find('.cloneable:last').remove();
update_remove_one_visibility();
});
};
$(document).ready(function() {
makeCloneable('#budgetary-responsibilities');
});
})(); | 1 | 0.028571 | 1 | 0 |
c877f773ab99488a00b755fd6400212d7743a205 | app/views/users/show.html.erb | app/views/users/show.html.erb | <h2><%= @user.username %>'s Characters:</h2>
<span class="email">Email: <%=@user.email %></span>
<ul class="character-list">
<% @user.characters.each do |character| %>
<li>
<a href="/characters/<%= character.id %>"><%= character.name %></a>
<% if character.user == current_user %>
<%= render partial: '/characters/character_controls', locals: {character: character} %>
<% end %>
</li>
<% end %>
</ul>
<% if current_user %>
<% if @user.id == current_user.id %>
<a href="/characters/new"><button>Create a New Character</button></a>
<% end %>
<% end %>
| <h2><%= @user.username %>'s Characters:</h2>
<ul class="character-list">
<% @user.characters.each do |character| %>
<li>
<a href="/characters/<%= character.id %>"><%= character.name %></a>
<% if character.user == current_user %>
<%= render partial: '/characters/character_controls', locals: {character: character} %>
<% end %>
</li>
<% end %>
</ul>
<% if current_user %>
<% if @user.id == current_user.id %>
<a href="/characters/new"><button>Create a New Character</button></a>
<% end %>
<% end %>
| Remove email from user display | Remove email from user display
| HTML+ERB | mit | jindigiordano/star-wars-character-generator,jindigiordano/star-wars-character-generator,jindigiordano/star-wars-character-generator | html+erb | ## Code Before:
<h2><%= @user.username %>'s Characters:</h2>
<span class="email">Email: <%=@user.email %></span>
<ul class="character-list">
<% @user.characters.each do |character| %>
<li>
<a href="/characters/<%= character.id %>"><%= character.name %></a>
<% if character.user == current_user %>
<%= render partial: '/characters/character_controls', locals: {character: character} %>
<% end %>
</li>
<% end %>
</ul>
<% if current_user %>
<% if @user.id == current_user.id %>
<a href="/characters/new"><button>Create a New Character</button></a>
<% end %>
<% end %>
## Instruction:
Remove email from user display
## Code After:
<h2><%= @user.username %>'s Characters:</h2>
<ul class="character-list">
<% @user.characters.each do |character| %>
<li>
<a href="/characters/<%= character.id %>"><%= character.name %></a>
<% if character.user == current_user %>
<%= render partial: '/characters/character_controls', locals: {character: character} %>
<% end %>
</li>
<% end %>
</ul>
<% if current_user %>
<% if @user.id == current_user.id %>
<a href="/characters/new"><button>Create a New Character</button></a>
<% end %>
<% end %>
| <h2><%= @user.username %>'s Characters:</h2>
- <span class="email">Email: <%=@user.email %></span>
<ul class="character-list">
<% @user.characters.each do |character| %>
<li>
<a href="/characters/<%= character.id %>"><%= character.name %></a>
<% if character.user == current_user %>
<%= render partial: '/characters/character_controls', locals: {character: character} %>
<% end %>
</li>
<% end %>
</ul>
<% if current_user %>
<% if @user.id == current_user.id %>
<a href="/characters/new"><button>Create a New Character</button></a>
<% end %>
<% end %> | 1 | 0.055556 | 0 | 1 |
96cb0288c4cee0c9820b965f1a27c459d6f732c5 | app/models/commute.rb | app/models/commute.rb | class Commute < ApplicationRecord
belongs_to :user
validates :user_id, presence: true
default_scope -> { order(starttime: :desc) }
def startcommute(lat, lon)
if user.hasActiveCommute == true
raise "Current user already has an active commute."
end
self.starttime = Time.now
self.startLat = is_float(lat) ? lat.to_f : nil
self.startLon = is_float(lon) ? lon.to_f : nil
end
def endcommute(lat, lon)
if user.hasActiveCommute == false
raise "Current user does not have an active commute."
elsif user.currentCommute != self.id
raise "Current commute does not belong to current user."
end
self.endtime = Time.now
self.endLat = is_float(lat) ? lat.to_f : nil
self.endLon = is_float(lon) ? lon.to_f : nil
end
private
def is_float(input)
begin
input.to_f
return true unless input.blank?
rescue
return false
end
end
end | class Commute < ApplicationRecord
belongs_to :user
validates :user_id, presence: true
default_scope -> { order(starttime: :desc) }
def startcommute(lat, lon)
if user.hasActiveCommute == true
raise "Current user already has an active commute."
end
self.starttime = Time.now
if (is_float(lat) && is_float(lon))
self.startLat = lat.to_f
self.startLon = lon.to_f
end
end
def endcommute(lat, lon)
if user.hasActiveCommute == false
raise "Current user does not have an active commute."
elsif user.currentCommute != self.id
raise "Current commute does not belong to current user."
end
self.endtime = Time.now
if (is_float(lat) && is_float(lon))
self.endLat = lat.to_f
self.endLon = lon.to_f
end
end
private
def is_float(input)
if (input.nil? || input.blank?)
return false
end
if (input.is_a? Float)
return true
elsif (input.to_f != 0.0)
return true
else
return false
end
end
end | Improve checking for coordinate inputs | Improve checking for coordinate inputs
| Ruby | mit | kevindong/CommuteTracker,kevindong/CommuteTracker,kevindong/CommuteTracker | ruby | ## Code Before:
class Commute < ApplicationRecord
belongs_to :user
validates :user_id, presence: true
default_scope -> { order(starttime: :desc) }
def startcommute(lat, lon)
if user.hasActiveCommute == true
raise "Current user already has an active commute."
end
self.starttime = Time.now
self.startLat = is_float(lat) ? lat.to_f : nil
self.startLon = is_float(lon) ? lon.to_f : nil
end
def endcommute(lat, lon)
if user.hasActiveCommute == false
raise "Current user does not have an active commute."
elsif user.currentCommute != self.id
raise "Current commute does not belong to current user."
end
self.endtime = Time.now
self.endLat = is_float(lat) ? lat.to_f : nil
self.endLon = is_float(lon) ? lon.to_f : nil
end
private
def is_float(input)
begin
input.to_f
return true unless input.blank?
rescue
return false
end
end
end
## Instruction:
Improve checking for coordinate inputs
## Code After:
class Commute < ApplicationRecord
belongs_to :user
validates :user_id, presence: true
default_scope -> { order(starttime: :desc) }
def startcommute(lat, lon)
if user.hasActiveCommute == true
raise "Current user already has an active commute."
end
self.starttime = Time.now
if (is_float(lat) && is_float(lon))
self.startLat = lat.to_f
self.startLon = lon.to_f
end
end
def endcommute(lat, lon)
if user.hasActiveCommute == false
raise "Current user does not have an active commute."
elsif user.currentCommute != self.id
raise "Current commute does not belong to current user."
end
self.endtime = Time.now
if (is_float(lat) && is_float(lon))
self.endLat = lat.to_f
self.endLon = lon.to_f
end
end
private
def is_float(input)
if (input.nil? || input.blank?)
return false
end
if (input.is_a? Float)
return true
elsif (input.to_f != 0.0)
return true
else
return false
end
end
end | class Commute < ApplicationRecord
belongs_to :user
validates :user_id, presence: true
default_scope -> { order(starttime: :desc) }
def startcommute(lat, lon)
if user.hasActiveCommute == true
raise "Current user already has an active commute."
end
self.starttime = Time.now
- self.startLat = is_float(lat) ? lat.to_f : nil
- self.startLon = is_float(lon) ? lon.to_f : nil
+ if (is_float(lat) && is_float(lon))
+ self.startLat = lat.to_f
+ self.startLon = lon.to_f
+ end
end
def endcommute(lat, lon)
if user.hasActiveCommute == false
raise "Current user does not have an active commute."
elsif user.currentCommute != self.id
raise "Current commute does not belong to current user."
end
self.endtime = Time.now
- self.endLat = is_float(lat) ? lat.to_f : nil
- self.endLon = is_float(lon) ? lon.to_f : nil
+ if (is_float(lat) && is_float(lon))
+ self.endLat = lat.to_f
+ self.endLon = lon.to_f
+ end
end
private
def is_float(input)
+ if (input.nil? || input.blank?)
+ return false
- begin
? - --
+ end
? +
- input.to_f
- return true unless input.blank?
+ if (input.is_a? Float)
+ return true
+ elsif (input.to_f != 0.0)
+ return true
- rescue
? - --
+ else
? +
return false
end
end
end | 24 | 0.685714 | 16 | 8 |
39c1b4a5fd163bc2a09e5f8de87456f7a9e99ce7 | Pragma/Router/Request.php | Pragma/Router/Request.php | <?php
namespace Pragma\Router;
class Request{
protected $path = '';
protected $method = '';
private static $request = null;//singleton
public function __construct(){
$this->path = trim(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/');
$this->path = str_replace(array('/index.php', '/index.html'), '', $this->path);
$this->path = str_replace(array('/admin.php', '/admin.html'), '/admin', $this->path);
$this->path = !empty($this->path) ? $this->path.($this->path=='/admin'?'/':'') : '/';
$this->method = strtolower($_SERVER['REQUEST_METHOD']);
if(!empty($this->method) && $this->method == 'post'){//we need to check _METHOD
if(!empty($_POST['_METHOD'])){
$verb = strtolower($_POST['_METHOD']);
switch($verb){
case 'delete':
case 'put':
case 'patch':
$this->method = $verb;
break;
}
}
}
}
public static function getRequest(){
if(is_null(self::$request)){
self::$request = new Request();
}
return self::$request;
}
public function getPath(){
return $this->path;
}
public function getMethod(){
return $this->method;
}
}
| <?php
namespace Pragma\Router;
class Request{
protected $path = '';
protected $method = '';
private static $request = null;//singleton
public function __construct(){
$this->path = parse_url(trim(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/'), PHP_URL_PATH);
$this->method = strtolower($_SERVER['REQUEST_METHOD']);
if(!empty($this->method) && $this->method == 'post'){//we need to check _METHOD
if(!empty($_POST['_METHOD'])){
$verb = strtolower($_POST['_METHOD']);
switch($verb){
case 'delete':
case 'put':
case 'patch':
$this->method = $verb;
break;
}
}
}
}
public static function getRequest(){
if(is_null(self::$request)){
self::$request = new Request();
}
return self::$request;
}
public function getPath(){
return $this->path;
}
public function getMethod(){
return $this->method;
}
}
| Fix compatibility of REQUEST_URI parsing | Fix compatibility of REQUEST_URI parsing
| PHP | mit | pips-/core,pragma-framework/core | php | ## Code Before:
<?php
namespace Pragma\Router;
class Request{
protected $path = '';
protected $method = '';
private static $request = null;//singleton
public function __construct(){
$this->path = trim(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/');
$this->path = str_replace(array('/index.php', '/index.html'), '', $this->path);
$this->path = str_replace(array('/admin.php', '/admin.html'), '/admin', $this->path);
$this->path = !empty($this->path) ? $this->path.($this->path=='/admin'?'/':'') : '/';
$this->method = strtolower($_SERVER['REQUEST_METHOD']);
if(!empty($this->method) && $this->method == 'post'){//we need to check _METHOD
if(!empty($_POST['_METHOD'])){
$verb = strtolower($_POST['_METHOD']);
switch($verb){
case 'delete':
case 'put':
case 'patch':
$this->method = $verb;
break;
}
}
}
}
public static function getRequest(){
if(is_null(self::$request)){
self::$request = new Request();
}
return self::$request;
}
public function getPath(){
return $this->path;
}
public function getMethod(){
return $this->method;
}
}
## Instruction:
Fix compatibility of REQUEST_URI parsing
## Code After:
<?php
namespace Pragma\Router;
class Request{
protected $path = '';
protected $method = '';
private static $request = null;//singleton
public function __construct(){
$this->path = parse_url(trim(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/'), PHP_URL_PATH);
$this->method = strtolower($_SERVER['REQUEST_METHOD']);
if(!empty($this->method) && $this->method == 'post'){//we need to check _METHOD
if(!empty($_POST['_METHOD'])){
$verb = strtolower($_POST['_METHOD']);
switch($verb){
case 'delete':
case 'put':
case 'patch':
$this->method = $verb;
break;
}
}
}
}
public static function getRequest(){
if(is_null(self::$request)){
self::$request = new Request();
}
return self::$request;
}
public function getPath(){
return $this->path;
}
public function getMethod(){
return $this->method;
}
}
| <?php
namespace Pragma\Router;
class Request{
protected $path = '';
protected $method = '';
private static $request = null;//singleton
public function __construct(){
- $this->path = trim(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/');
+ $this->path = parse_url(trim(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/'), PHP_URL_PATH);
? ++++++++++ +++++++++++++++
- $this->path = str_replace(array('/index.php', '/index.html'), '', $this->path);
- $this->path = str_replace(array('/admin.php', '/admin.html'), '/admin', $this->path);
- $this->path = !empty($this->path) ? $this->path.($this->path=='/admin'?'/':'') : '/';
$this->method = strtolower($_SERVER['REQUEST_METHOD']);
if(!empty($this->method) && $this->method == 'post'){//we need to check _METHOD
if(!empty($_POST['_METHOD'])){
$verb = strtolower($_POST['_METHOD']);
switch($verb){
case 'delete':
case 'put':
case 'patch':
$this->method = $verb;
break;
}
}
}
}
public static function getRequest(){
if(is_null(self::$request)){
self::$request = new Request();
}
return self::$request;
}
public function getPath(){
return $this->path;
}
public function getMethod(){
return $this->method;
}
} | 5 | 0.106383 | 1 | 4 |
201a05609c7ec89385cf3d5a74703bae0c0729a2 | tests/Limenius/Liform/Tests/LiformTestCase.php | tests/Limenius/Liform/Tests/LiformTestCase.php | <?php
namespace Limenius\Liform\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Form\Forms;
use Limenius\Liform\Form\Extension\AddLiformExtension;
/**
*
* Common test utils
*
* @see TestCase
*/
class LiformTestCase extends \PHPUnit_Framework_TestCase
{
/**
* @var FormFactoryInterface
*/
protected $factory;
protected function setUp()
{
$ext = new AddLiformExtension();
$this->factory = Forms::createFormFactoryBuilder()
->addExtensions([])
->addTypeExtensions([$ext])
->getFormFactory();
}
}
| <?php
namespace Limenius\Liform\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Form\Forms;
use Limenius\Liform\Form\Extension\AddLiformExtension;
/**
*
* Common test utils
*
* @see TestCase
*/
class LiformTestCase extends TestCase
{
/**
* @var FormFactoryInterface
*/
protected $factory;
protected function setUp()
{
$ext = new AddLiformExtension();
$this->factory = Forms::createFormFactoryBuilder()
->addExtensions([])
->addTypeExtensions([$ext])
->getFormFactory();
}
}
| Update tests to phpunit 6 | Update tests to phpunit 6
| PHP | mit | Limenius/Liform | php | ## Code Before:
<?php
namespace Limenius\Liform\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Form\Forms;
use Limenius\Liform\Form\Extension\AddLiformExtension;
/**
*
* Common test utils
*
* @see TestCase
*/
class LiformTestCase extends \PHPUnit_Framework_TestCase
{
/**
* @var FormFactoryInterface
*/
protected $factory;
protected function setUp()
{
$ext = new AddLiformExtension();
$this->factory = Forms::createFormFactoryBuilder()
->addExtensions([])
->addTypeExtensions([$ext])
->getFormFactory();
}
}
## Instruction:
Update tests to phpunit 6
## Code After:
<?php
namespace Limenius\Liform\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Form\Forms;
use Limenius\Liform\Form\Extension\AddLiformExtension;
/**
*
* Common test utils
*
* @see TestCase
*/
class LiformTestCase extends TestCase
{
/**
* @var FormFactoryInterface
*/
protected $factory;
protected function setUp()
{
$ext = new AddLiformExtension();
$this->factory = Forms::createFormFactoryBuilder()
->addExtensions([])
->addTypeExtensions([$ext])
->getFormFactory();
}
}
| <?php
namespace Limenius\Liform\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Form\Forms;
use Limenius\Liform\Form\Extension\AddLiformExtension;
/**
*
* Common test utils
*
* @see TestCase
*/
- class LiformTestCase extends \PHPUnit_Framework_TestCase
? -------------------
+ class LiformTestCase extends TestCase
{
/**
* @var FormFactoryInterface
*/
protected $factory;
protected function setUp()
{
$ext = new AddLiformExtension();
$this->factory = Forms::createFormFactoryBuilder()
->addExtensions([])
->addTypeExtensions([$ext])
->getFormFactory();
}
} | 2 | 0.066667 | 1 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.