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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
77a2d9987faa49e97a565d9dd93bd1b8b07bd5d6 | .travis.yml | .travis.yml | language: c
compiler:
- gcc
- clang
notifications:
recipients:
- kenhys@gmail.com
branches:
only:
- master
- develop
before_script:
- curl --location https://raw.github.com/kenhys/sylpheed-plugin-factory/master/misc/setup-travis.sh | sh
- git submodule update --init --recursive
- ./autogen.sh
script:
- ./configure --with-sylpheed-build-dir=`pwd`/sylpheed
- make
| language: c
compiler:
- gcc
- clang
notifications:
recipients:
- kenhys@gmail.com
branches:
only:
- master
- develop
env:
- SYLPHEED_STAGE=master
- SYLPHEED_STAGE=3.5
- SYLPHEED_STAGE=3.4
before_script:
- curl --location https://raw.github.com/kenhys/sylpheed-plugin-factory/master/misc/setup-travis.sh | sh
- git submodule update --init --recursive
- ./autogen.sh
script:
- ./configure --with-sylpheed-build-dir=`pwd`/sylpheed
- make
| Add supported version of Sylpheed | Add supported version of Sylpheed
| YAML | bsd-2-clause | kenhys/sylpheed-switch-signature,kenhys/sylpheed-switch-signature | yaml | ## Code Before:
language: c
compiler:
- gcc
- clang
notifications:
recipients:
- kenhys@gmail.com
branches:
only:
- master
- develop
before_script:
- curl --location https://raw.github.com/kenhys/sylpheed-plugin-factory/master/misc/setup-travis.sh | sh
- git submodule update --init --recursive
- ./autogen.sh
script:
- ./configure --with-sylpheed-build-dir=`pwd`/sylpheed
- make
## Instruction:
Add supported version of Sylpheed
## Code After:
language: c
compiler:
- gcc
- clang
notifications:
recipients:
- kenhys@gmail.com
branches:
only:
- master
- develop
env:
- SYLPHEED_STAGE=master
- SYLPHEED_STAGE=3.5
- SYLPHEED_STAGE=3.4
before_script:
- curl --location https://raw.github.com/kenhys/sylpheed-plugin-factory/master/misc/setup-travis.sh | sh
- git submodule update --init --recursive
- ./autogen.sh
script:
- ./configure --with-sylpheed-build-dir=`pwd`/sylpheed
- make
| language: c
compiler:
- gcc
- clang
notifications:
recipients:
- kenhys@gmail.com
branches:
only:
- master
- develop
+ env:
+ - SYLPHEED_STAGE=master
+ - SYLPHEED_STAGE=3.5
+ - SYLPHEED_STAGE=3.4
before_script:
- curl --location https://raw.github.com/kenhys/sylpheed-plugin-factory/master/misc/setup-travis.sh | sh
- git submodule update --init --recursive
- ./autogen.sh
script:
- ./configure --with-sylpheed-build-dir=`pwd`/sylpheed
- make | 4 | 0.222222 | 4 | 0 |
28aaae4bbbbf7c06ef026555c480ba3f180f0fb2 | ansible/roles/base/tasks/os-redhat.yml | ansible/roles/base/tasks/os-redhat.yml | ---
- name: Install development packages
action: yum name='@development' state=latest
- name: Install the RHEL EPEL repos for extra packages
yum: name={{ package_to_install }} state=latest
with_items:
- scl-utils
- centos-release-scl-rh
- epel-release
loop_control:
loop_var: package_to_install
- name: Install need system libraries and tools
yum: name={{ package_to_install }} state=latest
with_items:
- bash
- bash-completion
- openssl
- openssl-devel
- rng-tools
- libxml2-devel
- libjpeg
- libjpeg-devel
- bzip2-devel
- freetype
- freetype-devel
- zlib-devel
- postgresql-libs
- sqlite-devel
loop_control:
loop_var: package_to_install
- name: Install base packages
yum: name={{ package_to_install }} state=latest
with_items:
- curl
- htop
- git
- mercurial
- psmisc #pstree
- lsof
loop_control:
loop_var: package_to_install
- name: IInstall Python System-level packages
yum: name={{ package_to_install }} state=latest
with_items:
- python27
- python27-python-devel
- python-pip
- python33
- python-virtualenv
loop_control:
loop_var: package_to_install
| ---
- name: Install development packages
action: yum name='@development' state=latest
- name: Install the RHEL EPEL repos for extra packages
yum: name={{ package_to_install }} state=latest
with_items:
- scl-utils
- centos-release-scl-rh
- epel-release
loop_control:
loop_var: package_to_install
- name: Install need system libraries and tools
yum: name={{ package_to_install }} state=latest
with_items:
- bash
- bash-completion
- openssl
- openssl-devel
- rng-tools
- libxml2-devel
- libjpeg
- libjpeg-devel
- bzip2-devel
- freetype
- freetype-devel
- zlib-devel
- postgresql-libs
- sqlite-devel
loop_control:
loop_var: package_to_install
- name: Install base packages
yum: name={{ package_to_install }} state=latest
with_items:
- curl
- htop
- git
- mercurial
- psmisc #pstree
- lsof
loop_control:
loop_var: package_to_install
- name: Install Python System-level packages
yum: name={{ package_to_install }} state=latest
with_items:
- python27
- python27-python-devel
- python27-python-virtualenv
- python-pip
- python34
- python34-devel
- python34-virtualenv
- python34-pip
loop_control:
loop_var: package_to_install
| Update the base role for redhat to support newer version of python 3 | Update the base role for redhat to support newer version of python 3
| YAML | mit | JoeJasinski/ansible-django-stack | yaml | ## Code Before:
---
- name: Install development packages
action: yum name='@development' state=latest
- name: Install the RHEL EPEL repos for extra packages
yum: name={{ package_to_install }} state=latest
with_items:
- scl-utils
- centos-release-scl-rh
- epel-release
loop_control:
loop_var: package_to_install
- name: Install need system libraries and tools
yum: name={{ package_to_install }} state=latest
with_items:
- bash
- bash-completion
- openssl
- openssl-devel
- rng-tools
- libxml2-devel
- libjpeg
- libjpeg-devel
- bzip2-devel
- freetype
- freetype-devel
- zlib-devel
- postgresql-libs
- sqlite-devel
loop_control:
loop_var: package_to_install
- name: Install base packages
yum: name={{ package_to_install }} state=latest
with_items:
- curl
- htop
- git
- mercurial
- psmisc #pstree
- lsof
loop_control:
loop_var: package_to_install
- name: IInstall Python System-level packages
yum: name={{ package_to_install }} state=latest
with_items:
- python27
- python27-python-devel
- python-pip
- python33
- python-virtualenv
loop_control:
loop_var: package_to_install
## Instruction:
Update the base role for redhat to support newer version of python 3
## Code After:
---
- name: Install development packages
action: yum name='@development' state=latest
- name: Install the RHEL EPEL repos for extra packages
yum: name={{ package_to_install }} state=latest
with_items:
- scl-utils
- centos-release-scl-rh
- epel-release
loop_control:
loop_var: package_to_install
- name: Install need system libraries and tools
yum: name={{ package_to_install }} state=latest
with_items:
- bash
- bash-completion
- openssl
- openssl-devel
- rng-tools
- libxml2-devel
- libjpeg
- libjpeg-devel
- bzip2-devel
- freetype
- freetype-devel
- zlib-devel
- postgresql-libs
- sqlite-devel
loop_control:
loop_var: package_to_install
- name: Install base packages
yum: name={{ package_to_install }} state=latest
with_items:
- curl
- htop
- git
- mercurial
- psmisc #pstree
- lsof
loop_control:
loop_var: package_to_install
- name: Install Python System-level packages
yum: name={{ package_to_install }} state=latest
with_items:
- python27
- python27-python-devel
- python27-python-virtualenv
- python-pip
- python34
- python34-devel
- python34-virtualenv
- python34-pip
loop_control:
loop_var: package_to_install
| ---
- name: Install development packages
action: yum name='@development' state=latest
- name: Install the RHEL EPEL repos for extra packages
yum: name={{ package_to_install }} state=latest
with_items:
- scl-utils
- centos-release-scl-rh
- epel-release
loop_control:
loop_var: package_to_install
- name: Install need system libraries and tools
yum: name={{ package_to_install }} state=latest
with_items:
- bash
- bash-completion
- openssl
- openssl-devel
- rng-tools
- libxml2-devel
- libjpeg
- libjpeg-devel
- bzip2-devel
- freetype
- freetype-devel
- zlib-devel
- postgresql-libs
- sqlite-devel
loop_control:
loop_var: package_to_install
- name: Install base packages
yum: name={{ package_to_install }} state=latest
with_items:
- curl
- htop
- git
- mercurial
- psmisc #pstree
- lsof
loop_control:
loop_var: package_to_install
- - name: IInstall Python System-level packages
? -
+ - name: Install Python System-level packages
yum: name={{ package_to_install }} state=latest
with_items:
- python27
- python27-python-devel
+ - python27-python-virtualenv
- python-pip
- - python33
? ^
+ - python34
? ^
+ - python34-devel
- - python-virtualenv
+ - python34-virtualenv
? ++
+ - python34-pip
loop_control:
loop_var: package_to_install | 9 | 0.157895 | 6 | 3 |
889a153c18dc115da692b7e0d903dadd0c9fcfe0 | config/locales/admin.en-US.yml | config/locales/admin.en-US.yml | i18n:
en-US:
admin:
core:
title: Nodeca admin panel
menus:
navbar:
system: System
sidebar:
settings: Global settings
| i18n:
en-US:
admin:
core:
title: Nodeca admin panel
menus:
navbar:
system: System
sidebar:
settings: Global settings
settings:
usergroups:
group_visible_title: Group visible
group_visible_help: Boolean flag, show this group in member list?
| Add i18n phrases for usergroups setting | Add i18n phrases for usergroups setting
| YAML | mit | nodeca/nodeca.core,nodeca/nodeca.core | yaml | ## Code Before:
i18n:
en-US:
admin:
core:
title: Nodeca admin panel
menus:
navbar:
system: System
sidebar:
settings: Global settings
## Instruction:
Add i18n phrases for usergroups setting
## Code After:
i18n:
en-US:
admin:
core:
title: Nodeca admin panel
menus:
navbar:
system: System
sidebar:
settings: Global settings
settings:
usergroups:
group_visible_title: Group visible
group_visible_help: Boolean flag, show this group in member list?
| i18n:
en-US:
admin:
core:
title: Nodeca admin panel
menus:
navbar:
system: System
sidebar:
settings: Global settings
+
+ settings:
+ usergroups:
+ group_visible_title: Group visible
+ group_visible_help: Boolean flag, show this group in member list? | 5 | 0.5 | 5 | 0 |
cc0429e9c42d02f70f8b267eb764c34aeda4b69c | project.clj | project.clj | (defproject clojurescript-npm "0.2.0-SNAPSHOT"
:description "The ClojureScript Programming Language, packaged for Node.js"
:url "https://github.com/nasser/clojurescript-npm"
:license {:name "Eclipse Public License"
:url "http://nasser.github.io/clojurescript-npm/blob/master/LICENSE"}
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.170"]
[replumb/replumb "0.2.1"]]
:clean-targets [:target-path "out"]
:plugins [[lein-cljsbuild "1.1.1"]]
:cljsbuild {
:builds [{
:source-paths ["src"]
:compiler {
:main clojurescript.core
:output-to "lib/bootstrap.js"
:output-dir "out"
:optimizations :simple}}]}) | (defproject clojurescript-npm "0.2.0-SNAPSHOT"
:description "The ClojureScript Programming Language, packaged for Node.js"
:url "https://github.com/nasser/clojurescript-npm"
:license {:name "Eclipse Public License"
:url "http://nasser.github.io/clojurescript-npm/blob/master/LICENSE"}
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.170"]
[replumb/replumb "0.2.1"]]
:clean-targets [:target-path "out"]
:plugins [[lein-cljsbuild "1.1.1"]]
:cljsbuild {
:builds [{
:source-paths ["src"]
:compiler {
:main clojurescript.core
:output-to "lib/bootstrap.js"
:output-dir "out"
:target :nodejs
:optimizations :simple}}]})
| Set nodejs as the target | Set nodejs as the target | Clojure | epl-1.0 | nasser/clojurescript-npm | clojure | ## Code Before:
(defproject clojurescript-npm "0.2.0-SNAPSHOT"
:description "The ClojureScript Programming Language, packaged for Node.js"
:url "https://github.com/nasser/clojurescript-npm"
:license {:name "Eclipse Public License"
:url "http://nasser.github.io/clojurescript-npm/blob/master/LICENSE"}
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.170"]
[replumb/replumb "0.2.1"]]
:clean-targets [:target-path "out"]
:plugins [[lein-cljsbuild "1.1.1"]]
:cljsbuild {
:builds [{
:source-paths ["src"]
:compiler {
:main clojurescript.core
:output-to "lib/bootstrap.js"
:output-dir "out"
:optimizations :simple}}]})
## Instruction:
Set nodejs as the target
## Code After:
(defproject clojurescript-npm "0.2.0-SNAPSHOT"
:description "The ClojureScript Programming Language, packaged for Node.js"
:url "https://github.com/nasser/clojurescript-npm"
:license {:name "Eclipse Public License"
:url "http://nasser.github.io/clojurescript-npm/blob/master/LICENSE"}
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.170"]
[replumb/replumb "0.2.1"]]
:clean-targets [:target-path "out"]
:plugins [[lein-cljsbuild "1.1.1"]]
:cljsbuild {
:builds [{
:source-paths ["src"]
:compiler {
:main clojurescript.core
:output-to "lib/bootstrap.js"
:output-dir "out"
:target :nodejs
:optimizations :simple}}]})
| (defproject clojurescript-npm "0.2.0-SNAPSHOT"
:description "The ClojureScript Programming Language, packaged for Node.js"
:url "https://github.com/nasser/clojurescript-npm"
:license {:name "Eclipse Public License"
:url "http://nasser.github.io/clojurescript-npm/blob/master/LICENSE"}
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.170"]
[replumb/replumb "0.2.1"]]
:clean-targets [:target-path "out"]
:plugins [[lein-cljsbuild "1.1.1"]]
:cljsbuild {
:builds [{
:source-paths ["src"]
:compiler {
:main clojurescript.core
:output-to "lib/bootstrap.js"
:output-dir "out"
+ :target :nodejs
:optimizations :simple}}]}) | 1 | 0.055556 | 1 | 0 |
66ea709700490b44f71c519117be63fb84ca4d26 | lib/hexflex.rb | lib/hexflex.rb | require "active_support"
require "active_support/core_ext"
require "yaml"
require "hexflex/hexaflexagon"
module Hexflex
class << self
def make_template_vector(side_fills: [:cyan, :magenta, :yellow], template: :tape)
template = Hexaflexagon.new(side_fills).as_template(template)
template.make_vector
end
def create_template_image!(output_file_name: 'out.png', side_fills: nil, template: nil)
hexflex_opts = {}
hexflex_opts[:side_fills] = side_fills unless side_fills.nil?
hexflex_opts[:template] = template unless template.nil?
vector = make_template_vector(hexflex_opts)
vector.draw.write(output_file_name)
end
end
end
| require "active_support"
require "active_support/core_ext"
require "yaml"
require "hexflex/hexaflexagon"
module Hexflex
class << self
DEFAULT_SIDE_FILLS = [:cyan, :magenta, :yellow]
DEFAULT_TEMPLATE = :tape
def make_template_vector(side_fills: DEFAULT_SIDE_FILLS, template: DEFAULT_TEMPLATE)
template = Hexaflexagon.new(side_fills).as_template(template)
template.make_vector
end
def create_template_image!(output_file_name: 'out.png', side_fills: DEFAULT_SIDE_FILLS, template: DEFAULT_TEMPLATE)
vector = make_template_vector(side_fills: side_fills, template: template)
vector.draw.write(output_file_name)
end
end
end
| Refactor out constants for default template | Refactor out constants for default template
| Ruby | mit | aauthor/hexflex,aauthor/hexflex | ruby | ## Code Before:
require "active_support"
require "active_support/core_ext"
require "yaml"
require "hexflex/hexaflexagon"
module Hexflex
class << self
def make_template_vector(side_fills: [:cyan, :magenta, :yellow], template: :tape)
template = Hexaflexagon.new(side_fills).as_template(template)
template.make_vector
end
def create_template_image!(output_file_name: 'out.png', side_fills: nil, template: nil)
hexflex_opts = {}
hexflex_opts[:side_fills] = side_fills unless side_fills.nil?
hexflex_opts[:template] = template unless template.nil?
vector = make_template_vector(hexflex_opts)
vector.draw.write(output_file_name)
end
end
end
## Instruction:
Refactor out constants for default template
## Code After:
require "active_support"
require "active_support/core_ext"
require "yaml"
require "hexflex/hexaflexagon"
module Hexflex
class << self
DEFAULT_SIDE_FILLS = [:cyan, :magenta, :yellow]
DEFAULT_TEMPLATE = :tape
def make_template_vector(side_fills: DEFAULT_SIDE_FILLS, template: DEFAULT_TEMPLATE)
template = Hexaflexagon.new(side_fills).as_template(template)
template.make_vector
end
def create_template_image!(output_file_name: 'out.png', side_fills: DEFAULT_SIDE_FILLS, template: DEFAULT_TEMPLATE)
vector = make_template_vector(side_fills: side_fills, template: template)
vector.draw.write(output_file_name)
end
end
end
| require "active_support"
require "active_support/core_ext"
require "yaml"
require "hexflex/hexaflexagon"
module Hexflex
class << self
- def make_template_vector(side_fills: [:cyan, :magenta, :yellow], template: :tape)
+
+ DEFAULT_SIDE_FILLS = [:cyan, :magenta, :yellow]
+ DEFAULT_TEMPLATE = :tape
+
+ def make_template_vector(side_fills: DEFAULT_SIDE_FILLS, template: DEFAULT_TEMPLATE)
template = Hexaflexagon.new(side_fills).as_template(template)
template.make_vector
end
- def create_template_image!(output_file_name: 'out.png', side_fills: nil, template: nil)
? ^^^ ^^^
+ def create_template_image!(output_file_name: 'out.png', side_fills: DEFAULT_SIDE_FILLS, template: DEFAULT_TEMPLATE)
? ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
+ vector = make_template_vector(side_fills: side_fills, template: template)
- hexflex_opts = {}
- hexflex_opts[:side_fills] = side_fills unless side_fills.nil?
- hexflex_opts[:template] = template unless template.nil?
- vector = make_template_vector(hexflex_opts)
vector.draw.write(output_file_name)
end
end
end | 13 | 0.541667 | 7 | 6 |
f1c22958d77e453faa352aa9f247e27d2d18ef9e | src/components/ContextualMenu/ContextualMenu.Multiselect.html | src/components/ContextualMenu/ContextualMenu.Multiselect.html | <ul class="ms-ContextualMenu is-open">
<li class="ms-ContextualMenu-item ms-ContextualMenu-item--header">SORT BY</li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">Date</a></li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">Sender</a></li>
<li class="ms-ContextualMenu-item ms-ContextualMenu-item--divider"></li>
<li class="ms-ContextualMenu-item ms-ContextualMenu-item--header">ORDER</li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">Newest on top</a></li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">Oldest on top</a></li>
<li class="ms-ContextualMenu-item ms-ContextualMenu-item--divider"></li>
<li class="ms-ContextualMenu-item ms-ContextualMenu-item--header">CONVERSATIONS</li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">On</a></li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">Off</a></li>
</ul>
| <ul class="ms-ContextualMenu ms-ContextualMenu--multiselect is-open">
<li class="ms-ContextualMenu-item ms-ContextualMenu-item--header">SORT BY</li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">Date</a></li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">Sender</a></li>
<li class="ms-ContextualMenu-item ms-ContextualMenu-item--divider"></li>
<li class="ms-ContextualMenu-item ms-ContextualMenu-item--header">ORDER</li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">Newest on top</a></li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">Oldest on top</a></li>
<li class="ms-ContextualMenu-item ms-ContextualMenu-item--divider"></li>
<li class="ms-ContextualMenu-item ms-ContextualMenu-item--header">CONVERSATIONS</li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">On</a></li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">Off</a></li>
</ul>
| Add variant class name to template for multiselect menu | Add variant class name to template for multiselect menu
| HTML | mit | adjohnson916/Office-UI-Fabric,adjohnson916/Office-UI-Fabric | html | ## Code Before:
<ul class="ms-ContextualMenu is-open">
<li class="ms-ContextualMenu-item ms-ContextualMenu-item--header">SORT BY</li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">Date</a></li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">Sender</a></li>
<li class="ms-ContextualMenu-item ms-ContextualMenu-item--divider"></li>
<li class="ms-ContextualMenu-item ms-ContextualMenu-item--header">ORDER</li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">Newest on top</a></li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">Oldest on top</a></li>
<li class="ms-ContextualMenu-item ms-ContextualMenu-item--divider"></li>
<li class="ms-ContextualMenu-item ms-ContextualMenu-item--header">CONVERSATIONS</li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">On</a></li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">Off</a></li>
</ul>
## Instruction:
Add variant class name to template for multiselect menu
## Code After:
<ul class="ms-ContextualMenu ms-ContextualMenu--multiselect is-open">
<li class="ms-ContextualMenu-item ms-ContextualMenu-item--header">SORT BY</li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">Date</a></li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">Sender</a></li>
<li class="ms-ContextualMenu-item ms-ContextualMenu-item--divider"></li>
<li class="ms-ContextualMenu-item ms-ContextualMenu-item--header">ORDER</li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">Newest on top</a></li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">Oldest on top</a></li>
<li class="ms-ContextualMenu-item ms-ContextualMenu-item--divider"></li>
<li class="ms-ContextualMenu-item ms-ContextualMenu-item--header">CONVERSATIONS</li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">On</a></li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">Off</a></li>
</ul>
| - <ul class="ms-ContextualMenu is-open">
+ <ul class="ms-ContextualMenu ms-ContextualMenu--multiselect is-open">
<li class="ms-ContextualMenu-item ms-ContextualMenu-item--header">SORT BY</li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">Date</a></li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">Sender</a></li>
<li class="ms-ContextualMenu-item ms-ContextualMenu-item--divider"></li>
<li class="ms-ContextualMenu-item ms-ContextualMenu-item--header">ORDER</li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">Newest on top</a></li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">Oldest on top</a></li>
<li class="ms-ContextualMenu-item ms-ContextualMenu-item--divider"></li>
<li class="ms-ContextualMenu-item ms-ContextualMenu-item--header">CONVERSATIONS</li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">On</a></li>
<li class="ms-ContextualMenu-item"><a class="ms-ContextualMenu-link" href="#">Off</a></li>
</ul> | 2 | 0.153846 | 1 | 1 |
d4352b498f3d6c65f0454884d596253effb9932b | lib/entry.js | lib/entry.js | /**
* Module dependencies.
*/
var utils = require('./utils');
/**
* `Entry` constructor.
*
* An entry is conceptually a reverse route, used to map from a controller
* action to the URL pattern which dispatches to it.
*
* @api private
*/
function Entry(controller, action, pattern) {
this.controller = controller;
this.action = action;
this.pattern = pattern;
utils.pathRegexp(pattern, this.keys = []);
};
/**
* Build path.
*
* Builds a path for the entry, substituting any placeholders with the
* corresponding value from `options`.
*
* @param {Object} options
* @return {String}
* @api protected
*/
Entry.prototype.path = function(options) {
options = options || {};
var self = this
, path = this.pattern;
this.keys.forEach(function(key) {
if (!key.optional) {
if (!options[key.name]) { throw new Error('Unable to substitute value for ":' + key.name + '" in URL pattern "' + self.pattern + '"'); }
path = path.replace(':' + key.name, options[key.name]);
} else {
var replacement = options[key.name] ? '$1' + options[key.name] : '';
path = path.replace(new RegExp('(\\.?\\/?):' + key.name + '\\?'), replacement);
}
});
return path;
}
/**
* Expose `Entry`.
*/
module.exports = Entry;
| /**
* Module dependencies.
*/
var utils = require('./utils');
/**
* `Entry` constructor.
*
* An entry is conceptually a reverse route, used to map from a controller
* action to the URL pattern which dispatches to it.
*
* @api private
*/
function Entry(controller, action, pattern) {
this.controller = controller;
this.action = action;
this.pattern = pattern;
utils.pathRegexp(pattern, this.keys = []);
};
/**
* Build path.
*
* Builds a path for the entry, substituting any placeholders with the
* corresponding value from `options`.
*
* @param {Object} options
* @return {String}
* @api protected
*/
Entry.prototype.path = function(options) {
options = options || {};
var self = this
, path = this.pattern;
this.keys.forEach(function(key) {
if (!key.optional) {
if (!options[key.name] && options[key.name] !== 0) { throw new Error('Unable to substitute value for ":' + key.name + '" in URL pattern "' + self.pattern + '"'); }
path = path.replace(':' + key.name, options[key.name]);
} else {
var replacement = options[key.name] ? '$1' + options[key.name] : '';
path = path.replace(new RegExp('(\\.?\\/?):' + key.name + '\\?'), replacement);
}
});
return path;
}
/**
* Expose `Entry`.
*/
module.exports = Entry;
| Fix to support path substitution with 0 value. | Fix to support path substitution with 0 value.
| JavaScript | mit | jaredhanson/chai-locomotive-helpers | javascript | ## Code Before:
/**
* Module dependencies.
*/
var utils = require('./utils');
/**
* `Entry` constructor.
*
* An entry is conceptually a reverse route, used to map from a controller
* action to the URL pattern which dispatches to it.
*
* @api private
*/
function Entry(controller, action, pattern) {
this.controller = controller;
this.action = action;
this.pattern = pattern;
utils.pathRegexp(pattern, this.keys = []);
};
/**
* Build path.
*
* Builds a path for the entry, substituting any placeholders with the
* corresponding value from `options`.
*
* @param {Object} options
* @return {String}
* @api protected
*/
Entry.prototype.path = function(options) {
options = options || {};
var self = this
, path = this.pattern;
this.keys.forEach(function(key) {
if (!key.optional) {
if (!options[key.name]) { throw new Error('Unable to substitute value for ":' + key.name + '" in URL pattern "' + self.pattern + '"'); }
path = path.replace(':' + key.name, options[key.name]);
} else {
var replacement = options[key.name] ? '$1' + options[key.name] : '';
path = path.replace(new RegExp('(\\.?\\/?):' + key.name + '\\?'), replacement);
}
});
return path;
}
/**
* Expose `Entry`.
*/
module.exports = Entry;
## Instruction:
Fix to support path substitution with 0 value.
## Code After:
/**
* Module dependencies.
*/
var utils = require('./utils');
/**
* `Entry` constructor.
*
* An entry is conceptually a reverse route, used to map from a controller
* action to the URL pattern which dispatches to it.
*
* @api private
*/
function Entry(controller, action, pattern) {
this.controller = controller;
this.action = action;
this.pattern = pattern;
utils.pathRegexp(pattern, this.keys = []);
};
/**
* Build path.
*
* Builds a path for the entry, substituting any placeholders with the
* corresponding value from `options`.
*
* @param {Object} options
* @return {String}
* @api protected
*/
Entry.prototype.path = function(options) {
options = options || {};
var self = this
, path = this.pattern;
this.keys.forEach(function(key) {
if (!key.optional) {
if (!options[key.name] && options[key.name] !== 0) { throw new Error('Unable to substitute value for ":' + key.name + '" in URL pattern "' + self.pattern + '"'); }
path = path.replace(':' + key.name, options[key.name]);
} else {
var replacement = options[key.name] ? '$1' + options[key.name] : '';
path = path.replace(new RegExp('(\\.?\\/?):' + key.name + '\\?'), replacement);
}
});
return path;
}
/**
* Expose `Entry`.
*/
module.exports = Entry;
| /**
* Module dependencies.
*/
var utils = require('./utils');
/**
* `Entry` constructor.
*
* An entry is conceptually a reverse route, used to map from a controller
* action to the URL pattern which dispatches to it.
*
* @api private
*/
function Entry(controller, action, pattern) {
this.controller = controller;
this.action = action;
this.pattern = pattern;
utils.pathRegexp(pattern, this.keys = []);
};
/**
* Build path.
*
* Builds a path for the entry, substituting any placeholders with the
* corresponding value from `options`.
*
* @param {Object} options
* @return {String}
* @api protected
*/
Entry.prototype.path = function(options) {
options = options || {};
var self = this
, path = this.pattern;
this.keys.forEach(function(key) {
if (!key.optional) {
- if (!options[key.name]) { throw new Error('Unable to substitute value for ":' + key.name + '" in URL pattern "' + self.pattern + '"'); }
+ if (!options[key.name] && options[key.name] !== 0) { throw new Error('Unable to substitute value for ":' + key.name + '" in URL pattern "' + self.pattern + '"'); }
? +++++++++++++++++++++++++++
path = path.replace(':' + key.name, options[key.name]);
} else {
var replacement = options[key.name] ? '$1' + options[key.name] : '';
path = path.replace(new RegExp('(\\.?\\/?):' + key.name + '\\?'), replacement);
}
});
return path;
}
/**
* Expose `Entry`.
*/
module.exports = Entry; | 2 | 0.037037 | 1 | 1 |
fa2e43ee0079584126026c0d9aa4abb6a0e1b455 | InstaWin/InstaWin.Shared/config/config.json | InstaWin/InstaWin.Shared/config/config.json | {
"$schema": "/schema/schema-manifest.json",
"start_url": "https://instagram.com/",
"wat_customScript": {
"scriptFiles._comment": "An array of custom script files stored within the app package that are injected into the DOM",
"scriptFiles": [
"injection-scriptjs"
]
},
"wat_styles": {
"customCssFile._comment": "This enables you to embed CSS styles which get inserted over the existing styles on your website. This is great for adjusting the style of the site when it is presented as an application. This can be used as an alterntive to the injected-styles.css.",
"customCssFile": "/css/injected-styles.css"
}
}
| {
"$schema": "/schema/schema-manifest.json",
"start_url": "https://instagram.com/",
"wat_customScript": {
"scriptFiles._comment": "An array of custom script files stored within the app package that are injected into the DOM",
"scriptFiles": [
"injection-script.js"
]
},
"wat_styles": {
"customCssFile._comment": "This enables you to embed CSS styles which get inserted over the existing styles on your website. This is great for adjusting the style of the site when it is presented as an application. This can be used as an alterntive to the injected-styles.css.",
"customCssFile": "css/injected-styles.css"
},
"wat_appBar": {
"enabled": true,
"makeSticky": false,
"buttons": [
{
"label": "Settings",
"icon": "edit",
"action": "settings"
},
{
"label": "Manage profile",
"icon": "contactinfo",
"action": "https://instagram.com/accounts/edit/",
"section": "selection"
}
]
}
}
| Add appbar & fix injections | Add appbar & fix injections
| JSON | mit | svedm/InstaWin,svedm/InstaWin,svedm/InstaWin | json | ## Code Before:
{
"$schema": "/schema/schema-manifest.json",
"start_url": "https://instagram.com/",
"wat_customScript": {
"scriptFiles._comment": "An array of custom script files stored within the app package that are injected into the DOM",
"scriptFiles": [
"injection-scriptjs"
]
},
"wat_styles": {
"customCssFile._comment": "This enables you to embed CSS styles which get inserted over the existing styles on your website. This is great for adjusting the style of the site when it is presented as an application. This can be used as an alterntive to the injected-styles.css.",
"customCssFile": "/css/injected-styles.css"
}
}
## Instruction:
Add appbar & fix injections
## Code After:
{
"$schema": "/schema/schema-manifest.json",
"start_url": "https://instagram.com/",
"wat_customScript": {
"scriptFiles._comment": "An array of custom script files stored within the app package that are injected into the DOM",
"scriptFiles": [
"injection-script.js"
]
},
"wat_styles": {
"customCssFile._comment": "This enables you to embed CSS styles which get inserted over the existing styles on your website. This is great for adjusting the style of the site when it is presented as an application. This can be used as an alterntive to the injected-styles.css.",
"customCssFile": "css/injected-styles.css"
},
"wat_appBar": {
"enabled": true,
"makeSticky": false,
"buttons": [
{
"label": "Settings",
"icon": "edit",
"action": "settings"
},
{
"label": "Manage profile",
"icon": "contactinfo",
"action": "https://instagram.com/accounts/edit/",
"section": "selection"
}
]
}
}
| {
"$schema": "/schema/schema-manifest.json",
"start_url": "https://instagram.com/",
"wat_customScript": {
"scriptFiles._comment": "An array of custom script files stored within the app package that are injected into the DOM",
"scriptFiles": [
- "injection-scriptjs"
+ "injection-script.js"
? +
]
},
- "wat_styles": {
? ^^^^
+ "wat_styles": {
? ^
- "customCssFile._comment": "This enables you to embed CSS styles which get inserted over the existing styles on your website. This is great for adjusting the style of the site when it is presented as an application. This can be used as an alterntive to the injected-styles.css.",
? ^^^^^^^^
+ "customCssFile._comment": "This enables you to embed CSS styles which get inserted over the existing styles on your website. This is great for adjusting the style of the site when it is presented as an application. This can be used as an alterntive to the injected-styles.css.",
? ^^
- "customCssFile": "/css/injected-styles.css"
? ^^^^^^^^ -
+ "customCssFile": "css/injected-styles.css"
? ^^
+ },
+
+ "wat_appBar": {
+ "enabled": true,
+ "makeSticky": false,
+ "buttons": [
+ {
+ "label": "Settings",
+ "icon": "edit",
+ "action": "settings"
+ },
+ {
+ "label": "Manage profile",
+ "icon": "contactinfo",
+ "action": "https://instagram.com/accounts/edit/",
+ "section": "selection"
+ }
+ ]
}
} | 26 | 1.625 | 22 | 4 |
3e32b82be6fc1250fc98e4571a40e87b8611784d | resources/assets/sass/_components.scss | resources/assets/sass/_components.scss | // views
@import './views/admin';
@import './views/app';
@import './views/dashboard';
@import './views/editor';
@import './views/media';
@import './views/site-list';
// components
@import './components/block-list';
@import './components/block-sidebar';
@import './components/icon';
@import './components/page-list';
@import './components/page-sidebar';
@import './components/snackbar';
@import './components/upload-form';
@import './components/upload-status';
| // views
@import './views/admin';
@import './views/app';
@import './views/dashboard';
@import './views/editor';
@import './views/media';
@import './views/site-list';
// components
@import './components/block-list';
@import './components/block-sidebar';
@import './components/icon';
@import './components/page-list';
@import './components/page-sidebar';
@import './components/snackbar';
@import './components/upload-form';
@import './components/upload-status';
@import './components/media-upload';
| Add media upload styles to component scss file. | Add media upload styles to component scss file.
| SCSS | mit | unikent/astro,unikent/astro,unikent/astro,unikent/astro,unikent/astro | scss | ## Code Before:
// views
@import './views/admin';
@import './views/app';
@import './views/dashboard';
@import './views/editor';
@import './views/media';
@import './views/site-list';
// components
@import './components/block-list';
@import './components/block-sidebar';
@import './components/icon';
@import './components/page-list';
@import './components/page-sidebar';
@import './components/snackbar';
@import './components/upload-form';
@import './components/upload-status';
## Instruction:
Add media upload styles to component scss file.
## Code After:
// views
@import './views/admin';
@import './views/app';
@import './views/dashboard';
@import './views/editor';
@import './views/media';
@import './views/site-list';
// components
@import './components/block-list';
@import './components/block-sidebar';
@import './components/icon';
@import './components/page-list';
@import './components/page-sidebar';
@import './components/snackbar';
@import './components/upload-form';
@import './components/upload-status';
@import './components/media-upload';
| // views
@import './views/admin';
@import './views/app';
@import './views/dashboard';
@import './views/editor';
@import './views/media';
@import './views/site-list';
// components
@import './components/block-list';
@import './components/block-sidebar';
@import './components/icon';
@import './components/page-list';
@import './components/page-sidebar';
@import './components/snackbar';
@import './components/upload-form';
@import './components/upload-status';
+ @import './components/media-upload'; | 1 | 0.058824 | 1 | 0 |
a47ffd1644258bca4c166c4ab4aced57bc4a9421 | dev/www/templates/signin.html | dev/www/templates/signin.html | <ion-view title="Sign In" ng-controller="loginController">
<ion-header-bar class="bar-calm">
<h1 class="title">Sign In</h1>
</ion-header-bar>
<ion-content class="has-header padding">
<form class="list">
<label class="item item-input">
<button class="button button-block button-stable" type= "submit" ng-click="validateUser('facebook')">Facebook</button>
</label>
<!-- <label class="item item-input">
<button class="button button-block button-stable" type= "submit" ng-click="validateUser('twitter')">Twitter</button>
</label> -->
<label class="item item-input">
<button class="button button-block button-stable" type= "submit" ng-click="validateUser('google')">Google</button>
</label>
</form>
<h1 style='text-align:center'>Geolocation must be enabled.</h1>
</ion-content>
</ion-view>
| <ion-view title="Sign In" ng-controller="loginController">
<ion-header-bar class="bar-calm">
<h1 class="title">Sign In</h1>
</ion-header-bar>
<ion-content class="has-header padding">
<form class="list">
<label class="item item-input">
<button class="button button-block button-stable" type= "submit" ng-click="validateUser('facebook')">Facebook</button>
</label>
<!--
<label class="item item-input">
<button class="button button-block button-stable" type= "submit" ng-click="validateUser('twitter')">Twitter</button>
</label>
-->
<label class="item item-input">
<button class="button button-block button-stable" type= "submit" ng-click="validateUser('google')">Google</button>
</label>
</form>
<br>
<h1 style='text-align:center'>You must allow Fastpass Exchange to use your current location.</h1>
</ion-content>
</ion-view>
| Change "geolocation required" text on home page | Change "geolocation required" text on home page
| HTML | mit | fastpassexchange/fastpass,fastpassexchange/fastpass,fastpassexchange/fastpass,fastpassexchange/fastpass,fastpassexchange/fastpass,fastpassexchange/fastpass | html | ## Code Before:
<ion-view title="Sign In" ng-controller="loginController">
<ion-header-bar class="bar-calm">
<h1 class="title">Sign In</h1>
</ion-header-bar>
<ion-content class="has-header padding">
<form class="list">
<label class="item item-input">
<button class="button button-block button-stable" type= "submit" ng-click="validateUser('facebook')">Facebook</button>
</label>
<!-- <label class="item item-input">
<button class="button button-block button-stable" type= "submit" ng-click="validateUser('twitter')">Twitter</button>
</label> -->
<label class="item item-input">
<button class="button button-block button-stable" type= "submit" ng-click="validateUser('google')">Google</button>
</label>
</form>
<h1 style='text-align:center'>Geolocation must be enabled.</h1>
</ion-content>
</ion-view>
## Instruction:
Change "geolocation required" text on home page
## Code After:
<ion-view title="Sign In" ng-controller="loginController">
<ion-header-bar class="bar-calm">
<h1 class="title">Sign In</h1>
</ion-header-bar>
<ion-content class="has-header padding">
<form class="list">
<label class="item item-input">
<button class="button button-block button-stable" type= "submit" ng-click="validateUser('facebook')">Facebook</button>
</label>
<!--
<label class="item item-input">
<button class="button button-block button-stable" type= "submit" ng-click="validateUser('twitter')">Twitter</button>
</label>
-->
<label class="item item-input">
<button class="button button-block button-stable" type= "submit" ng-click="validateUser('google')">Google</button>
</label>
</form>
<br>
<h1 style='text-align:center'>You must allow Fastpass Exchange to use your current location.</h1>
</ion-content>
</ion-view>
| <ion-view title="Sign In" ng-controller="loginController">
<ion-header-bar class="bar-calm">
<h1 class="title">Sign In</h1>
</ion-header-bar>
<ion-content class="has-header padding">
<form class="list">
<label class="item item-input">
<button class="button button-block button-stable" type= "submit" ng-click="validateUser('facebook')">Facebook</button>
</label>
+ <!--
- <!-- <label class="item item-input">
? ----
+ <label class="item item-input">
<button class="button button-block button-stable" type= "submit" ng-click="validateUser('twitter')">Twitter</button>
- </label> -->
? ----
+ </label>
+ -->
- <label class="item item-input">
+ <label class="item item-input">
? +
<button class="button button-block button-stable" type= "submit" ng-click="validateUser('google')">Google</button>
</label>
</form>
- <h1 style='text-align:center'>Geolocation must be enabled.</h1>
+ <br>
+ <h1 style='text-align:center'>You must allow Fastpass Exchange to use your current location.</h1>
</ion-content>
</ion-view> | 11 | 0.578947 | 7 | 4 |
e706d5ffa5c338edc95a93f3039e8fe239a82e51 | app/src/main/java/com/sedsoftware/yaptalker/presentation/base/BaseView.kt | app/src/main/java/com/sedsoftware/yaptalker/presentation/base/BaseView.kt | package com.sedsoftware.yaptalker.presentation.base
import com.arellomobile.mvp.MvpView
import com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy
import com.arellomobile.mvp.viewstate.strategy.SkipStrategy
import com.arellomobile.mvp.viewstate.strategy.StateStrategyType
@StateStrategyType(AddToEndSingleStrategy::class)
interface BaseView : MvpView {
@StateStrategyType(SkipStrategy::class)
fun showErrorMessage(message: String)
fun showLoadingIndicator() {
// Default empty implementation
}
fun hideLoadingIndicator() {
// Default empty implementation
}
}
| package com.sedsoftware.yaptalker.presentation.base
import com.arellomobile.mvp.MvpView
import com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy
import com.arellomobile.mvp.viewstate.strategy.SkipStrategy
import com.arellomobile.mvp.viewstate.strategy.StateStrategyType
@StateStrategyType(SkipStrategy::class)
interface BaseView : MvpView {
fun showErrorMessage(message: String)
@StateStrategyType(value = AddToEndSingleStrategy::class, tag = "LoadingIndicator")
fun showLoadingIndicator() {
// Default empty implementation
}
@StateStrategyType(value = AddToEndSingleStrategy::class, tag = "LoadingIndicator")
fun hideLoadingIndicator() {
// Default empty implementation
}
}
| Test loading indicator strategy tweak | Test loading indicator strategy tweak
| Kotlin | apache-2.0 | djkovrik/YapTalker,djkovrik/YapTalker | kotlin | ## Code Before:
package com.sedsoftware.yaptalker.presentation.base
import com.arellomobile.mvp.MvpView
import com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy
import com.arellomobile.mvp.viewstate.strategy.SkipStrategy
import com.arellomobile.mvp.viewstate.strategy.StateStrategyType
@StateStrategyType(AddToEndSingleStrategy::class)
interface BaseView : MvpView {
@StateStrategyType(SkipStrategy::class)
fun showErrorMessage(message: String)
fun showLoadingIndicator() {
// Default empty implementation
}
fun hideLoadingIndicator() {
// Default empty implementation
}
}
## Instruction:
Test loading indicator strategy tweak
## Code After:
package com.sedsoftware.yaptalker.presentation.base
import com.arellomobile.mvp.MvpView
import com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy
import com.arellomobile.mvp.viewstate.strategy.SkipStrategy
import com.arellomobile.mvp.viewstate.strategy.StateStrategyType
@StateStrategyType(SkipStrategy::class)
interface BaseView : MvpView {
fun showErrorMessage(message: String)
@StateStrategyType(value = AddToEndSingleStrategy::class, tag = "LoadingIndicator")
fun showLoadingIndicator() {
// Default empty implementation
}
@StateStrategyType(value = AddToEndSingleStrategy::class, tag = "LoadingIndicator")
fun hideLoadingIndicator() {
// Default empty implementation
}
}
| package com.sedsoftware.yaptalker.presentation.base
import com.arellomobile.mvp.MvpView
import com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy
import com.arellomobile.mvp.viewstate.strategy.SkipStrategy
import com.arellomobile.mvp.viewstate.strategy.StateStrategyType
- @StateStrategyType(AddToEndSingleStrategy::class)
? -------- ^^^^
+ @StateStrategyType(SkipStrategy::class)
? + ^
interface BaseView : MvpView {
- @StateStrategyType(SkipStrategy::class)
fun showErrorMessage(message: String)
+ @StateStrategyType(value = AddToEndSingleStrategy::class, tag = "LoadingIndicator")
fun showLoadingIndicator() {
// Default empty implementation
}
+ @StateStrategyType(value = AddToEndSingleStrategy::class, tag = "LoadingIndicator")
fun hideLoadingIndicator() {
// Default empty implementation
}
} | 5 | 0.238095 | 3 | 2 |
7f4e92942d8d7c867352da8a0f2abff6672e9b38 | fabric/fuse-fabric/src/main/resources/distro/fabric/import/fabric/configs/versions/1.0/profiles/hawtio/org.fusesource.fabric.agent.properties | fabric/fuse-fabric/src/main/resources/distro/fabric/import/fabric/configs/versions/1.0/profiles/hawtio/org.fusesource.fabric.agent.properties |
feature.war=war
# Replace with the hawtio-dev feature to work on hawtio in developer mode
#
#feature.hawtio=hawtio-dev
feature.hawtio=hawtio
repository.fuse-fabric=mvn\:org.fusesource.fabric/fuse-fabric/${project.version}/xml/features
repository.karaf-enterprise=mvn\:org.apache.karaf.assemblies.features/enterprise/${karaf-version}/xml/features
repository.karaf-standard=mvn\:org.apache.karaf.assemblies.features/standard/${karaf-version}/xml/features
parents=default
|
feature.war=war
# Replace with the hawtio-dev feature to work on hawtio in developer mode
#
#feature.hawtio=hawtio-dev
feature.hawtio=hawtio
repository.hawtio=mvn\:io.hawt/hawtio-karaf/1.0-SNAPSHOT/xml/features
parents=default
| Add the hawtio feature descriptor in the hawtio profile | Add the hawtio feature descriptor in the hawtio profile
| INI | apache-2.0 | EricWittmann/fabric8,punkhorn/fabric8,dhirajsb/fabric8,jludvice/fabric8,zmhassan/fabric8,hekonsek/fabric8,sobkowiak/fabric8,christian-posta/fabric8,hekonsek/fabric8,tadayosi/fuse,joelschuster/fuse,PhilHardwick/fabric8,KurtStam/fabric8,dhirajsb/fabric8,mwringe/fabric8,sobkowiak/fuse,chirino/fuse,rhuss/fabric8,mwringe/fabric8,janstey/fuse-1,rhuss/fabric8,rnc/fabric8,gashcrumb/fabric8,janstey/fabric8,hekonsek/fabric8,chirino/fabric8v2,avano/fabric8,sobkowiak/fabric8,jonathanchristison/fabric8,KurtStam/fabric8,jimmidyson/fabric8,dhirajsb/fabric8,rnc/fabric8,KurtStam/fabric8,punkhorn/fabric8,chirino/fabric8,janstey/fuse,jimmidyson/fabric8,EricWittmann/fabric8,avano/fabric8,zmhassan/fabric8,gnodet/fuse,jonathanchristison/fabric8,janstey/fuse,tadayosi/fuse,christian-posta/fabric8,mwringe/fabric8,EricWittmann/fabric8,dhirajsb/fuse,janstey/fuse,dejanb/fuse,dejanb/fuse,janstey/fuse-1,KurtStam/fabric8,gashcrumb/fabric8,janstey/fuse,punkhorn/fuse,dhirajsb/fuse,sobkowiak/fabric8,jboss-fuse/fuse,rmarting/fuse,gnodet/fuse,migue/fabric8,rajdavies/fabric8,migue/fabric8,chirino/fabric8v2,punkhorn/fuse,aslakknutsen/fabric8,avano/fabric8,opensourceconsultant/fuse,rnc/fabric8,rmarting/fuse,zmhassan/fabric8,gnodet/fuse,gnodet/fuse,rajdavies/fabric8,rajdavies/fabric8,hekonsek/fabric8,ffang/fuse-1,EricWittmann/fabric8,janstey/fuse-1,janstey/fabric8,rhuss/fabric8,jboss-fuse/fuse,migue/fabric8,PhilHardwick/fabric8,PhilHardwick/fabric8,chirino/fabric8,chirino/fabric8v2,joelschuster/fuse,jimmidyson/fabric8,ffang/fuse-1,rhuss/fabric8,jonathanchristison/fabric8,gashcrumb/fabric8,hekonsek/fabric8,christian-posta/fabric8,opensourceconsultant/fuse,janstey/fabric8,chirino/fuse,rajdavies/fabric8,jimmidyson/fabric8,gashcrumb/fabric8,migue/fabric8,mwringe/fabric8,punkhorn/fabric8,jimmidyson/fabric8,dejanb/fuse,sobkowiak/fabric8,PhilHardwick/fabric8,aslakknutsen/fabric8,punkhorn/fabric8,rnc/fabric8,aslakknutsen/fabric8,rmarting/fuse,jonathanchristison/fabric8,opensourceconsultant/fuse,chirino/fabric8,cunningt/fuse,ffang/fuse-1,christian-posta/fabric8,cunningt/fuse,chirino/fabric8v2,avano/fabric8,joelschuster/fuse,dhirajsb/fabric8,jludvice/fabric8,rnc/fabric8,sobkowiak/fuse,jboss-fuse/fuse,jludvice/fabric8,chirino/fabric8,zmhassan/fabric8,jludvice/fabric8 | ini | ## Code Before:
feature.war=war
# Replace with the hawtio-dev feature to work on hawtio in developer mode
#
#feature.hawtio=hawtio-dev
feature.hawtio=hawtio
repository.fuse-fabric=mvn\:org.fusesource.fabric/fuse-fabric/${project.version}/xml/features
repository.karaf-enterprise=mvn\:org.apache.karaf.assemblies.features/enterprise/${karaf-version}/xml/features
repository.karaf-standard=mvn\:org.apache.karaf.assemblies.features/standard/${karaf-version}/xml/features
parents=default
## Instruction:
Add the hawtio feature descriptor in the hawtio profile
## Code After:
feature.war=war
# Replace with the hawtio-dev feature to work on hawtio in developer mode
#
#feature.hawtio=hawtio-dev
feature.hawtio=hawtio
repository.hawtio=mvn\:io.hawt/hawtio-karaf/1.0-SNAPSHOT/xml/features
parents=default
|
feature.war=war
# Replace with the hawtio-dev feature to work on hawtio in developer mode
#
#feature.hawtio=hawtio-dev
feature.hawtio=hawtio
+ repository.hawtio=mvn\:io.hawt/hawtio-karaf/1.0-SNAPSHOT/xml/features
- repository.fuse-fabric=mvn\:org.fusesource.fabric/fuse-fabric/${project.version}/xml/features
- repository.karaf-enterprise=mvn\:org.apache.karaf.assemblies.features/enterprise/${karaf-version}/xml/features
- repository.karaf-standard=mvn\:org.apache.karaf.assemblies.features/standard/${karaf-version}/xml/features
parents=default | 4 | 0.285714 | 1 | 3 |
32b9bd50b45d927fab211c70a786a13ea47c6b33 | client/layouts/settings/sidebar.html | client/layouts/settings/sidebar.html | <template name="settingsLayoutSidebar">
<aside class="main-sidebar">
<!-- sidebar: style can be found in sidebar.less -->
<section class="sidebar">
<!-- Sidebar Menu -->
<ul class="sidebar-menu">
<li class="header">Settings Menu</li>
<!-- Optionally, you can add icons to the links -->
<li>
<a href='{{ pathFor "activityTypesSettings" }}'>
<i class="fa fa-heart-o"></i>
<span>Activity Types</span>
</a>
</li>
<li>
<a href='{{ pathFor "dateTimeSettings" }}'>
<i class="fa fa-calendar"></i>
<span>Date/Time</span>
</a>
</li>
<li>
<a href='{{ pathFor "rolesSettings" }}'>
<i class="fa fa-user-md"></i>
<span>Roles</span>
</a>
</li>
</ul>
<!-- /.sidebar-menu -->
</section>
<!-- /.sidebar -->
</aside>
</template>
| <template name="settingsLayoutSidebar">
<aside class="main-sidebar">
<!-- sidebar: style can be found in sidebar.less -->
<section class="sidebar">
<!-- Sidebar Menu -->
<ul class="sidebar-menu">
<li class="header">Settings Menu</li>
<!-- Optionally, you can add icons to the links -->
<li>
<a href='{{ pathFor "activityTypesSettings" }}'>
<i class="fa fa-heart-o"></i>
<span>Activity Types</span>
</a>
</li>
<li>
<a href='{{ pathFor "dateTimeSettings" }}'>
<i class="fa fa-calendar"></i>
<span>Date/Time</span>
</a>
</li>
<li>
<a href='{{ pathFor "rolesSettings" }}'>
<i class="fa fa-user-md"></i>
<span>Roles</span>
</a>
</li>
<li>
<a href='{{ pathFor "usersSettings" }}'>
<i class="fa fa-users"></i>
<span>Users</span>
</a>
</li>
</ul>
<!-- /.sidebar-menu -->
</section>
<!-- /.sidebar -->
</aside>
</template>
| Add link to users page | Add link to users page
| HTML | agpl-3.0 | brylie/juhani-wellbeing,GeriLife/wellbeing,GeriLife/wellbeing,brylie/juhani-wellbeing,brylie/juhani-wellbeing,GeriLife/wellbeing,GeriLife/wellbeing,brylie/juhani-wellbeing | html | ## Code Before:
<template name="settingsLayoutSidebar">
<aside class="main-sidebar">
<!-- sidebar: style can be found in sidebar.less -->
<section class="sidebar">
<!-- Sidebar Menu -->
<ul class="sidebar-menu">
<li class="header">Settings Menu</li>
<!-- Optionally, you can add icons to the links -->
<li>
<a href='{{ pathFor "activityTypesSettings" }}'>
<i class="fa fa-heart-o"></i>
<span>Activity Types</span>
</a>
</li>
<li>
<a href='{{ pathFor "dateTimeSettings" }}'>
<i class="fa fa-calendar"></i>
<span>Date/Time</span>
</a>
</li>
<li>
<a href='{{ pathFor "rolesSettings" }}'>
<i class="fa fa-user-md"></i>
<span>Roles</span>
</a>
</li>
</ul>
<!-- /.sidebar-menu -->
</section>
<!-- /.sidebar -->
</aside>
</template>
## Instruction:
Add link to users page
## Code After:
<template name="settingsLayoutSidebar">
<aside class="main-sidebar">
<!-- sidebar: style can be found in sidebar.less -->
<section class="sidebar">
<!-- Sidebar Menu -->
<ul class="sidebar-menu">
<li class="header">Settings Menu</li>
<!-- Optionally, you can add icons to the links -->
<li>
<a href='{{ pathFor "activityTypesSettings" }}'>
<i class="fa fa-heart-o"></i>
<span>Activity Types</span>
</a>
</li>
<li>
<a href='{{ pathFor "dateTimeSettings" }}'>
<i class="fa fa-calendar"></i>
<span>Date/Time</span>
</a>
</li>
<li>
<a href='{{ pathFor "rolesSettings" }}'>
<i class="fa fa-user-md"></i>
<span>Roles</span>
</a>
</li>
<li>
<a href='{{ pathFor "usersSettings" }}'>
<i class="fa fa-users"></i>
<span>Users</span>
</a>
</li>
</ul>
<!-- /.sidebar-menu -->
</section>
<!-- /.sidebar -->
</aside>
</template>
| <template name="settingsLayoutSidebar">
<aside class="main-sidebar">
<!-- sidebar: style can be found in sidebar.less -->
<section class="sidebar">
<!-- Sidebar Menu -->
<ul class="sidebar-menu">
<li class="header">Settings Menu</li>
<!-- Optionally, you can add icons to the links -->
<li>
<a href='{{ pathFor "activityTypesSettings" }}'>
<i class="fa fa-heart-o"></i>
<span>Activity Types</span>
</a>
</li>
<li>
<a href='{{ pathFor "dateTimeSettings" }}'>
<i class="fa fa-calendar"></i>
<span>Date/Time</span>
</a>
</li>
<li>
<a href='{{ pathFor "rolesSettings" }}'>
<i class="fa fa-user-md"></i>
<span>Roles</span>
</a>
</li>
+ <li>
+ <a href='{{ pathFor "usersSettings" }}'>
+ <i class="fa fa-users"></i>
+ <span>Users</span>
+ </a>
+ </li>
</ul>
<!-- /.sidebar-menu -->
</section>
<!-- /.sidebar -->
</aside>
</template> | 6 | 0.176471 | 6 | 0 |
f5067d5d3f5bd3964e1619ca552cd2f0116e6c40 | .travis.yml | .travis.yml | sudo: false
language: node_js
node_js:
- 'stable'
- '0.12'
- '0.10'
before_script:
- npm install grunt-cli -g
script:
- npm run-script ci
| sudo: false
language: node_js
node_js:
- v0.10
- v0.12
- v4
- v5
before_script:
- npm install grunt-cli -g
script:
- npm run-script ci
| Test against v0.10, v0.12, v4, and v5 | Test against v0.10, v0.12, v4, and v5
| YAML | mit | ColeKettler/generator-flask-api,ColeKettler/generator-flask-api | yaml | ## Code Before:
sudo: false
language: node_js
node_js:
- 'stable'
- '0.12'
- '0.10'
before_script:
- npm install grunt-cli -g
script:
- npm run-script ci
## Instruction:
Test against v0.10, v0.12, v4, and v5
## Code After:
sudo: false
language: node_js
node_js:
- v0.10
- v0.12
- v4
- v5
before_script:
- npm install grunt-cli -g
script:
- npm run-script ci
| sudo: false
language: node_js
node_js:
- - 'stable'
- - '0.12'
- - '0.10'
? ^ -
+ - v0.10
? ^
+ - v0.12
+ - v4
+ - v5
before_script:
- npm install grunt-cli -g
script:
- npm run-script ci | 7 | 0.7 | 4 | 3 |
558d9630b4dc719d7b8d05fa59019704ae9ecd6f | browser/main.js | browser/main.js | /**
* Listens for the app launching then creates the window
*
* @see http://developer.chrome.com/trunk/apps/app.runtime.html
* @see http://developer.chrome.com/trunk/apps/app.window.html
*/
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('browser.html', {
'width': 1024,
'height': 768
});
});
| /**
* Listens for the app launching then creates the window
*
* @see http://developer.chrome.com/trunk/apps/app.runtime.html
* @see http://developer.chrome.com/trunk/apps/app.window.html
*/
chrome.app.runtime.onLaunched.addListener(function() {
runApp();
});
/**
* Listens for the app restarting then re-creates the window.
*
* @see http://developer.chrome.com/trunk/apps/app.runtime.html
*/
chrome.app.runtime.onRestarted.addListener(function() {
runApp();
});
/**
* Creates the window for the application.
*
* @see http://developer.chrome.com/trunk/apps/app.window.html
*/
function runApp() {
chrome.app.window.create('browser.html', {
'width': 1024,
'height': 768
});
}
| Add onRestarted listener, and restart app: crbug/167196, crbug/155221 | Add onRestarted listener, and restart app: crbug/167196, crbug/155221
| JavaScript | apache-2.0 | komacke/chrome-app-samples,jfdesrochers/chrome-app-samples,No9/chrome-app-samples,bthai2014/chrome-app-samples,gbrutkie/chrome-app-samples,newuserjim/chrome-app-samples,nik3daz/chrome-app-samples,vssranganadhp/chrome-app-samples,angeliaz/chrome-app-samples,nik3daz/chrome-app-samples,mchangeat/chrome-app-samples,ihappyk/chrome-app-samples,GoogleChrome/chrome-app-samples,joshuarossi/chrome-app-samples,bthai2014/chrome-app-samples,GoogleChrome/chrome-app-samples,pradeep-rajapaksha/chrome-app-samples,beni55/chrome-app-samples,ikarienator/chrome-app-samples,GoogleChrome/chrome-extensions-samples,srzmldl/chrome-app-samples,GoogleChrome/chrome-app-samples,gre370/chrome-app-samples,usfbrian/chrome-app-samples,ehazon/chrome-app-samples,ikarienator/chrome-app-samples,bthai2014/chrome-app-samples,bathos/chrome-app-samples,tsszh/chrome-app-samples,LyndaT/chrome-app-samples,ikarienator/chrome-app-samples,lag945/chrome-app-samples,bthai2014/chrome-app-samples,zilongqiu/chrome-app-samples,landsurveyorsunited/chrome-app-samples,GoogleChrome/chrome-app-samples,rmadziyauswa/chrome-app-samples,nik3daz/chrome-app-samples,bthai2014/chrome-app-samples,ksonglover/chrome-app-samples,michals/chrome-app-samples,reillyeon/chrome-app-samples,nik3daz/chrome-app-samples,GoogleChrome/chrome-extensions-samples,tamdao/chrome-app-samples,dexigner/chrome-app-samples,killerwilmer/chrome-app-samples,tksugimoto/chrome-app-samples,CodericSandbox/chrome-app-samples,roshan2806/chrome-app-samples,ikarienator/chrome-app-samples,amirhm/chrome-app-samples,shenyun2304/chrome-app-samples,ikarienator/chrome-app-samples,GoogleChrome/chrome-app-samples,phanhuy/chrome-app-samples,icasey/chrome-app-samples,nik3daz/chrome-app-samples,sgrizzi/tcpmonitor_test,MrSwiss/chrome-app-samples,GoogleChrome/chrome-app-samples,ChristineLaMuse/chrome-app-samples,GoogleChrome/chrome-app-samples,grman157/socket_udp,GoogleChrome/chrome-extensions-samples,serj1chen/chrome-app-samples,paramananda/chrome-app-samples,madtrapper/chrome-app-samples,MFolgado/chrome-app-samples,Jabqooo/chrome-app-samples,prasanna-rajapaksha/chrome-app-samples,sansiri20/chrome-app-samples,GoogleChrome/chrome-extensions-samples,GoogleChrome/chrome-app-samples,shansana/chrome-app-samples,GoogleChrome/chrome-extensions-samples,thenaughtychild/chrome-app-samples,PyNate/chrome-app-samples,nik3daz/chrome-app-samples,ehsan-karamad/chrome-app-samples,ptopenny/chrome-app-samples,GoogleChrome/chrome-extensions-samples,hjktiger10/sssss,bdunnette/chrome-app-samples,GoogleChrome/chrome-app-samples,ikarienator/chrome-app-samples,bthai2014/chrome-app-samples,ikarienator/chrome-app-samples,wearecharette/chrome-app-samples,nikodtb/chrome-app-samples,nik3daz/chrome-app-samples,gabrielduque/chrome-app-samples,bthai2014/chrome-app-samples,thmavri/chrome-app-samples,benaslinjenner/chrome-app-samples,oahziur/chrome-app-samples,hamperfect/chrome_extension_samples,GoogleChrome/chrome-extensions-samples,GoogleChrome/chrome-extensions-samples,KevinChien/chrome-app-samples,yetixxx83/chrome-app-samples,GoogleChrome/chrome-extensions-samples | javascript | ## Code Before:
/**
* Listens for the app launching then creates the window
*
* @see http://developer.chrome.com/trunk/apps/app.runtime.html
* @see http://developer.chrome.com/trunk/apps/app.window.html
*/
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('browser.html', {
'width': 1024,
'height': 768
});
});
## Instruction:
Add onRestarted listener, and restart app: crbug/167196, crbug/155221
## Code After:
/**
* Listens for the app launching then creates the window
*
* @see http://developer.chrome.com/trunk/apps/app.runtime.html
* @see http://developer.chrome.com/trunk/apps/app.window.html
*/
chrome.app.runtime.onLaunched.addListener(function() {
runApp();
});
/**
* Listens for the app restarting then re-creates the window.
*
* @see http://developer.chrome.com/trunk/apps/app.runtime.html
*/
chrome.app.runtime.onRestarted.addListener(function() {
runApp();
});
/**
* Creates the window for the application.
*
* @see http://developer.chrome.com/trunk/apps/app.window.html
*/
function runApp() {
chrome.app.window.create('browser.html', {
'width': 1024,
'height': 768
});
}
| /**
* Listens for the app launching then creates the window
*
* @see http://developer.chrome.com/trunk/apps/app.runtime.html
* @see http://developer.chrome.com/trunk/apps/app.window.html
*/
chrome.app.runtime.onLaunched.addListener(function() {
+ runApp();
+ });
+
+ /**
+ * Listens for the app restarting then re-creates the window.
+ *
+ * @see http://developer.chrome.com/trunk/apps/app.runtime.html
+ */
+ chrome.app.runtime.onRestarted.addListener(function() {
+ runApp();
+ });
+
+ /**
+ * Creates the window for the application.
+ *
+ * @see http://developer.chrome.com/trunk/apps/app.window.html
+ */
+ function runApp() {
chrome.app.window.create('browser.html', {
'width': 1024,
'height': 768
});
- });
+ } | 20 | 1.666667 | 19 | 1 |
cde902dded7d070fc7f8c069a7b12993e4a44666 | config/config.js | config/config.js | module.exports = {
dotEnvConfig: require('dotenv').config()
};
| 'use strict';
const {
join
} = require('path');
module.exports = {
dotEnvConfig: require('dotenv').config({
path: join(__dirname, '../.env')
})
};
| Fix issue with dotenv path in travis. | Fix issue with dotenv path in travis.
| JavaScript | mit | Code-Craftsmanship-Saturdays/sso-with-oauth-and-saml | javascript | ## Code Before:
module.exports = {
dotEnvConfig: require('dotenv').config()
};
## Instruction:
Fix issue with dotenv path in travis.
## Code After:
'use strict';
const {
join
} = require('path');
module.exports = {
dotEnvConfig: require('dotenv').config({
path: join(__dirname, '../.env')
})
};
| + 'use strict';
+
+ const {
+ join
+ } = require('path');
+
module.exports = {
- dotEnvConfig: require('dotenv').config()
? ^
+ dotEnvConfig: require('dotenv').config({
? ^
+ path: join(__dirname, '../.env')
+ })
}; | 10 | 3.333333 | 9 | 1 |
48cf18af79da6463074b8757b923f7ad1e6a5174 | .travis.yml | .travis.yml | sudo: true
language: cpp
compiler:
- gcc
- clang
env:
global:
- LD_LIBRARY_PATH="${TRAVIS_BUILD_DIR}/lib:${LD_LIBRARY_PATH}"
- CXXFLAGS="-g"
before_install:
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew update; fi
install:
- |
if [ "${CXX}" == "g++" ]; then
BUILD_CXXFLAGS="${CXXFLAGS} -fprofile-arcs -ftest-coverage"
TEST_CXXFLAGS="${CXXFLAGS} -lgcov --coverage"
fi
script:
- cd ${TRAVIS_BUILD_DIR}
- CXXFLAGS="${BUILD_CXXFLAGS}" make -j
- cd parser_sandbox
- CXXFLAGS="${BUILD_CXXFLAGS}" make -j
- cd ..
- CXXFLAGS="${TEST_CXXFLAGS}" make test
- cd parser_sandbox
- CXXFLAGS="${TEST_CXXFLAGS}" make test
after_success:
- |
if [ "${CXX}" != "clang++" ]; then
cd ${TRAVIS_BUILD_DIR}
bash <(curl -s https://codecov.io/bash)
fi
notifications:
email: false
| sudo: true
language: cpp
compiler:
- gcc
- clang
env:
global:
- LD_LIBRARY_PATH="${TRAVIS_BUILD_DIR}/lib:${LD_LIBRARY_PATH}"
- CXXFLAGS="-g"
before_install:
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew update; fi
install:
- |
if [ "${CXX}" == "g++" ]; then
BUILD_CXXFLAGS="${CXXFLAGS} -fprofile-arcs -ftest-coverage"
TEST_CXXFLAGS="${CXXFLAGS} -lgcov --coverage"
fi
script:
- cd ${TRAVIS_BUILD_DIR}
- CXXFLAGS="${BUILD_CXXFLAGS}" make -j
- cd parser_sandbox
- CXXFLAGS="${BUILD_CXXFLAGS}" make -j
- cd ..
- CXXFLAGS="${TEST_CXXFLAGS}" make test
- cd parser_sandbox
- CXXFLAGS="${TEST_CXXFLAGS}" make -j tests
- make test
after_success:
- |
if [ "${CXX}" != "clang++" ]; then
cd ${TRAVIS_BUILD_DIR}
bash <(curl -s https://codecov.io/bash)
fi
notifications:
email: false
| Build tests in parallel, run them sequentially | [CI] Build tests in parallel, run them sequentially
| YAML | mit | libocca/occa,libocca/occa,libocca/occa,libocca/occa | yaml | ## Code Before:
sudo: true
language: cpp
compiler:
- gcc
- clang
env:
global:
- LD_LIBRARY_PATH="${TRAVIS_BUILD_DIR}/lib:${LD_LIBRARY_PATH}"
- CXXFLAGS="-g"
before_install:
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew update; fi
install:
- |
if [ "${CXX}" == "g++" ]; then
BUILD_CXXFLAGS="${CXXFLAGS} -fprofile-arcs -ftest-coverage"
TEST_CXXFLAGS="${CXXFLAGS} -lgcov --coverage"
fi
script:
- cd ${TRAVIS_BUILD_DIR}
- CXXFLAGS="${BUILD_CXXFLAGS}" make -j
- cd parser_sandbox
- CXXFLAGS="${BUILD_CXXFLAGS}" make -j
- cd ..
- CXXFLAGS="${TEST_CXXFLAGS}" make test
- cd parser_sandbox
- CXXFLAGS="${TEST_CXXFLAGS}" make test
after_success:
- |
if [ "${CXX}" != "clang++" ]; then
cd ${TRAVIS_BUILD_DIR}
bash <(curl -s https://codecov.io/bash)
fi
notifications:
email: false
## Instruction:
[CI] Build tests in parallel, run them sequentially
## Code After:
sudo: true
language: cpp
compiler:
- gcc
- clang
env:
global:
- LD_LIBRARY_PATH="${TRAVIS_BUILD_DIR}/lib:${LD_LIBRARY_PATH}"
- CXXFLAGS="-g"
before_install:
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew update; fi
install:
- |
if [ "${CXX}" == "g++" ]; then
BUILD_CXXFLAGS="${CXXFLAGS} -fprofile-arcs -ftest-coverage"
TEST_CXXFLAGS="${CXXFLAGS} -lgcov --coverage"
fi
script:
- cd ${TRAVIS_BUILD_DIR}
- CXXFLAGS="${BUILD_CXXFLAGS}" make -j
- cd parser_sandbox
- CXXFLAGS="${BUILD_CXXFLAGS}" make -j
- cd ..
- CXXFLAGS="${TEST_CXXFLAGS}" make test
- cd parser_sandbox
- CXXFLAGS="${TEST_CXXFLAGS}" make -j tests
- make test
after_success:
- |
if [ "${CXX}" != "clang++" ]; then
cd ${TRAVIS_BUILD_DIR}
bash <(curl -s https://codecov.io/bash)
fi
notifications:
email: false
| sudo: true
language: cpp
compiler:
- gcc
- clang
env:
global:
- LD_LIBRARY_PATH="${TRAVIS_BUILD_DIR}/lib:${LD_LIBRARY_PATH}"
- CXXFLAGS="-g"
before_install:
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew update; fi
install:
- |
if [ "${CXX}" == "g++" ]; then
BUILD_CXXFLAGS="${CXXFLAGS} -fprofile-arcs -ftest-coverage"
TEST_CXXFLAGS="${CXXFLAGS} -lgcov --coverage"
fi
script:
- cd ${TRAVIS_BUILD_DIR}
- CXXFLAGS="${BUILD_CXXFLAGS}" make -j
- cd parser_sandbox
- CXXFLAGS="${BUILD_CXXFLAGS}" make -j
- cd ..
- CXXFLAGS="${TEST_CXXFLAGS}" make test
- cd parser_sandbox
- - CXXFLAGS="${TEST_CXXFLAGS}" make test
+ - CXXFLAGS="${TEST_CXXFLAGS}" make -j tests
? +++ +
+ - make test
after_success:
- |
if [ "${CXX}" != "clang++" ]; then
cd ${TRAVIS_BUILD_DIR}
bash <(curl -s https://codecov.io/bash)
fi
notifications:
email: false | 3 | 0.071429 | 2 | 1 |
00f7b3ad969cf4548bc324ce7afde31cfe97e91b | Context/SymfonyContext.php | Context/SymfonyContext.php | <?php
namespace A5sys\MinkContext\Context;
use Behat\MinkExtension\Context\MinkContext;
/**
* A symfony2 context
*/
class SymfonyContext extends MinkContext
{
use \A5sys\MinkContext\Traits\MinkTrait;
protected $em = null;
protected $kernel = null;
protected $container = null;
protected $doctrine = null;
/**
* Initializes context.
*
* @param Kernel $kernel
*/
public function __construct($kernel)
{
$this->kernel = $kernel;
$this->container = $kernel->getContainer();
$this->doctrine = $kernel->getContainer()->get('doctrine');
$this->em = $this->doctrine->getManager();
}
/**
*
* @return EntityManager
*/
protected function getEntityManager()
{
return $this->em;
}
/**
*
* @return Doctrine
*/
protected function getDoctrine()
{
return $this->doctrine;
}
/**
*
* @return Container
*/
protected function getContainer()
{
return $this->container;
}
/**
*
* @return AppKernel
*/
protected function getKernel()
{
return $this->kernel;
}
}
| <?php
namespace A5sys\MinkContext\Context;
use Behat\MinkExtension\Context\MinkContext;
/**
* A symfony2 context
*/
class SymfonyContext extends MinkContext
{
use \A5sys\MinkContext\Traits\MinkTrait;
protected $em = null;
protected $kernel = null;
protected $container = null;
protected $doctrine = null;
/**
* Initializes context.
*
* @param Kernel $kernel
*/
public function __construct($kernel)
{
$this->kernel = $kernel;
$this->container = $kernel->getContainer();
$this->doctrine = $kernel->getContainer()->get('doctrine');
$this->em = $this->doctrine->getManager();
}
/**
* Get a service
*
* @param string $serviceName The name of the service to retrieve
*
* @return Service
*/
public function getService($serviceName)
{
return $this->container->get($serviceName);
}
/**
*
* @return EntityManager
*/
protected function getEntityManager()
{
return $this->em;
}
/**
*
* @return Doctrine
*/
protected function getDoctrine()
{
return $this->doctrine;
}
/**
*
* @return Container
*/
protected function getContainer()
{
return $this->container;
}
/**
*
* @return AppKernel
*/
protected function getKernel()
{
return $this->kernel;
}
}
| Add the getService shorcut method | Add the getService shorcut method
| PHP | mit | A5sys/MinkContext | php | ## Code Before:
<?php
namespace A5sys\MinkContext\Context;
use Behat\MinkExtension\Context\MinkContext;
/**
* A symfony2 context
*/
class SymfonyContext extends MinkContext
{
use \A5sys\MinkContext\Traits\MinkTrait;
protected $em = null;
protected $kernel = null;
protected $container = null;
protected $doctrine = null;
/**
* Initializes context.
*
* @param Kernel $kernel
*/
public function __construct($kernel)
{
$this->kernel = $kernel;
$this->container = $kernel->getContainer();
$this->doctrine = $kernel->getContainer()->get('doctrine');
$this->em = $this->doctrine->getManager();
}
/**
*
* @return EntityManager
*/
protected function getEntityManager()
{
return $this->em;
}
/**
*
* @return Doctrine
*/
protected function getDoctrine()
{
return $this->doctrine;
}
/**
*
* @return Container
*/
protected function getContainer()
{
return $this->container;
}
/**
*
* @return AppKernel
*/
protected function getKernel()
{
return $this->kernel;
}
}
## Instruction:
Add the getService shorcut method
## Code After:
<?php
namespace A5sys\MinkContext\Context;
use Behat\MinkExtension\Context\MinkContext;
/**
* A symfony2 context
*/
class SymfonyContext extends MinkContext
{
use \A5sys\MinkContext\Traits\MinkTrait;
protected $em = null;
protected $kernel = null;
protected $container = null;
protected $doctrine = null;
/**
* Initializes context.
*
* @param Kernel $kernel
*/
public function __construct($kernel)
{
$this->kernel = $kernel;
$this->container = $kernel->getContainer();
$this->doctrine = $kernel->getContainer()->get('doctrine');
$this->em = $this->doctrine->getManager();
}
/**
* Get a service
*
* @param string $serviceName The name of the service to retrieve
*
* @return Service
*/
public function getService($serviceName)
{
return $this->container->get($serviceName);
}
/**
*
* @return EntityManager
*/
protected function getEntityManager()
{
return $this->em;
}
/**
*
* @return Doctrine
*/
protected function getDoctrine()
{
return $this->doctrine;
}
/**
*
* @return Container
*/
protected function getContainer()
{
return $this->container;
}
/**
*
* @return AppKernel
*/
protected function getKernel()
{
return $this->kernel;
}
}
| <?php
namespace A5sys\MinkContext\Context;
use Behat\MinkExtension\Context\MinkContext;
/**
* A symfony2 context
*/
class SymfonyContext extends MinkContext
{
use \A5sys\MinkContext\Traits\MinkTrait;
protected $em = null;
protected $kernel = null;
protected $container = null;
protected $doctrine = null;
/**
* Initializes context.
*
* @param Kernel $kernel
*/
public function __construct($kernel)
{
$this->kernel = $kernel;
$this->container = $kernel->getContainer();
$this->doctrine = $kernel->getContainer()->get('doctrine');
$this->em = $this->doctrine->getManager();
+ }
+
+ /**
+ * Get a service
+ *
+ * @param string $serviceName The name of the service to retrieve
+ *
+ * @return Service
+ */
+ public function getService($serviceName)
+ {
+ return $this->container->get($serviceName);
}
/**
*
* @return EntityManager
*/
protected function getEntityManager()
{
return $this->em;
}
/**
*
* @return Doctrine
*/
protected function getDoctrine()
{
return $this->doctrine;
}
/**
*
* @return Container
*/
protected function getContainer()
{
return $this->container;
}
/**
*
* @return AppKernel
*/
protected function getKernel()
{
return $this->kernel;
}
} | 12 | 0.179104 | 12 | 0 |
657a4c350195e6d618faa44249d9046dd4344d96 | modules/Screeenly/Http/Requests/CreateScreenshotRequest.php | modules/Screeenly/Http/Requests/CreateScreenshotRequest.php | <?php
namespace Screeenly\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Contracts\Validation\Validator;
class CreateScreenshotRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'key' => ['required', 'exists:api_keys,key'],
'url' => ['required', 'url'], // Is 'active_url' reliable enough?
'width' => ['sometimes', 'required', 'integer', 'max:2000', 'min:10'],
'height' => ['sometimes', 'required', 'integer', 'min:10'],
'delay' => ['sometimes', 'required', 'integer', 'max:10', 'min:0'],
];
}
}
| <?php
namespace Screeenly\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Contracts\Validation\Validator;
class CreateScreenshotRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'key' => ['required', 'exists:api_keys,key'],
'url' => ['required', 'url', 'active_url'],
'width' => ['sometimes', 'required', 'integer', 'max:2000', 'min:10'],
'height' => ['sometimes', 'required', 'integer', 'min:10'],
'delay' => ['sometimes', 'required', 'integer', 'max:10', 'min:0'],
];
}
}
| Add active_url to URL validation | Add active_url to URL validation
| PHP | mit | stefanzweifel/screeenly,stefanzweifel/screeenly,stefanzweifel/screeenly | php | ## Code Before:
<?php
namespace Screeenly\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Contracts\Validation\Validator;
class CreateScreenshotRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'key' => ['required', 'exists:api_keys,key'],
'url' => ['required', 'url'], // Is 'active_url' reliable enough?
'width' => ['sometimes', 'required', 'integer', 'max:2000', 'min:10'],
'height' => ['sometimes', 'required', 'integer', 'min:10'],
'delay' => ['sometimes', 'required', 'integer', 'max:10', 'min:0'],
];
}
}
## Instruction:
Add active_url to URL validation
## Code After:
<?php
namespace Screeenly\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Contracts\Validation\Validator;
class CreateScreenshotRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'key' => ['required', 'exists:api_keys,key'],
'url' => ['required', 'url', 'active_url'],
'width' => ['sometimes', 'required', 'integer', 'max:2000', 'min:10'],
'height' => ['sometimes', 'required', 'integer', 'min:10'],
'delay' => ['sometimes', 'required', 'integer', 'max:10', 'min:0'],
];
}
}
| <?php
namespace Screeenly\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Contracts\Validation\Validator;
class CreateScreenshotRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'key' => ['required', 'exists:api_keys,key'],
- 'url' => ['required', 'url'], // Is 'active_url' reliable enough?
? - ------ ^^^^^^^^^^^^^^^^^
+ 'url' => ['required', 'url', 'active_url'],
? ^^
'width' => ['sometimes', 'required', 'integer', 'max:2000', 'min:10'],
'height' => ['sometimes', 'required', 'integer', 'min:10'],
'delay' => ['sometimes', 'required', 'integer', 'max:10', 'min:0'],
];
}
} | 2 | 0.057143 | 1 | 1 |
e28da205788cc1f1e81b1b7b9f3f7ee9e204ad03 | server/models/applicant.js | server/models/applicant.js | var mongoose = require("mongoose");
var Schema = mongoose.Schema;
var applicantSchema = new Schema({
name: {
type: String,
required: true
},
email: {
type: String,
required: true,
lowercase: true
},
timeTaken: String
}, {timestamps: true});
applicantSchema.pre("save", function (next) {
this.setTimeTaken();
next();
});
applicantSchema.methods.setTimeTaken = function () {
var applicant = this;
var ms = Date.now() - this.createdAt;
var x = ms / 1000;
var seconds = Math.floor(x % 60);
x /= 60;
var minutes = Math.floor(x % 60);
x /= 60;
var hours = Math.floor(x % 24);
applicant.timeTaken = hours + "h:" + minutes + "m:" + seconds + "s";
};
module.exports = mongoose.model("Applicant", applicantSchema);
| var mongoose = require("mongoose");
var Schema = mongoose.Schema;
var applicantSchema = new Schema({
name: {
type: String,
required: true
},
email: {
type: String,
required: true,
lowercase: true
},
timeTaken: {
type: String,
default: "Not yet completed"
}
}, {timestamps: true});
applicantSchema.pre("save", function (next) {
this.setTimeTaken();
next();
});
applicantSchema.methods.setTimeTaken = function () {
var applicant = this;
var ms = Date.now() - this.createdAt;
var x = ms / 1000;
var seconds = Math.floor(x % 60);
x /= 60;
var minutes = Math.floor(x % 60);
x /= 60;
var hours = Math.floor(x % 24);
applicant.timeTaken = hours + "h:" + minutes + "m:" + seconds + "s";
};
module.exports = mongoose.model("Applicant", applicantSchema);
| Change timeTaken to default of Not yet completed | Change timeTaken to default of Not yet completed
| JavaScript | mit | bobziroll/admissions,bobziroll/admissions | javascript | ## Code Before:
var mongoose = require("mongoose");
var Schema = mongoose.Schema;
var applicantSchema = new Schema({
name: {
type: String,
required: true
},
email: {
type: String,
required: true,
lowercase: true
},
timeTaken: String
}, {timestamps: true});
applicantSchema.pre("save", function (next) {
this.setTimeTaken();
next();
});
applicantSchema.methods.setTimeTaken = function () {
var applicant = this;
var ms = Date.now() - this.createdAt;
var x = ms / 1000;
var seconds = Math.floor(x % 60);
x /= 60;
var minutes = Math.floor(x % 60);
x /= 60;
var hours = Math.floor(x % 24);
applicant.timeTaken = hours + "h:" + minutes + "m:" + seconds + "s";
};
module.exports = mongoose.model("Applicant", applicantSchema);
## Instruction:
Change timeTaken to default of Not yet completed
## Code After:
var mongoose = require("mongoose");
var Schema = mongoose.Schema;
var applicantSchema = new Schema({
name: {
type: String,
required: true
},
email: {
type: String,
required: true,
lowercase: true
},
timeTaken: {
type: String,
default: "Not yet completed"
}
}, {timestamps: true});
applicantSchema.pre("save", function (next) {
this.setTimeTaken();
next();
});
applicantSchema.methods.setTimeTaken = function () {
var applicant = this;
var ms = Date.now() - this.createdAt;
var x = ms / 1000;
var seconds = Math.floor(x % 60);
x /= 60;
var minutes = Math.floor(x % 60);
x /= 60;
var hours = Math.floor(x % 24);
applicant.timeTaken = hours + "h:" + minutes + "m:" + seconds + "s";
};
module.exports = mongoose.model("Applicant", applicantSchema);
| var mongoose = require("mongoose");
var Schema = mongoose.Schema;
var applicantSchema = new Schema({
name: {
type: String,
required: true
},
email: {
type: String,
required: true,
lowercase: true
},
- timeTaken: String
? ^^^^^^
+ timeTaken: {
? ^
+ type: String,
+ default: "Not yet completed"
+ }
}, {timestamps: true});
applicantSchema.pre("save", function (next) {
this.setTimeTaken();
next();
});
applicantSchema.methods.setTimeTaken = function () {
var applicant = this;
var ms = Date.now() - this.createdAt;
var x = ms / 1000;
var seconds = Math.floor(x % 60);
x /= 60;
var minutes = Math.floor(x % 60);
x /= 60;
var hours = Math.floor(x % 24);
applicant.timeTaken = hours + "h:" + minutes + "m:" + seconds + "s";
};
module.exports = mongoose.model("Applicant", applicantSchema); | 5 | 0.147059 | 4 | 1 |
aa85d09884bef45f0fe12065921aac4347b01ac2 | interoperability/package.json | interoperability/package.json | {
"license": "MIT",
"description": "interoperability tests with AWS SDK for Java",
"repository": {
"type": "git",
"url": "git://github.com/SaltwaterC/envelope-encryption-tools.git"
},
"dependencies": {
"aws-sdk": "= 2.106.0",
"node-rsa": "= 0.4.2",
"rimraf": "= 2.6.1"
}
}
| {
"private": true,
"license": "MIT",
"description": "interoperability tests with AWS SDK for Java",
"repository": {
"type": "git",
"url": "git://github.com/SaltwaterC/envelope-encryption-tools.git"
},
"dependencies": {
"aws-sdk": "= 2.106.0",
"node-rsa": "= 0.4.2",
"rimraf": "= 2.6.1"
}
}
| Add the private flag to interoperability to avoid being a complete numpty. | Add the private flag to interoperability to avoid being a complete numpty.
| JSON | mit | SaltwaterC/envelope-encryption-tools,SaltwaterC/envelope-encryption-tools | json | ## Code Before:
{
"license": "MIT",
"description": "interoperability tests with AWS SDK for Java",
"repository": {
"type": "git",
"url": "git://github.com/SaltwaterC/envelope-encryption-tools.git"
},
"dependencies": {
"aws-sdk": "= 2.106.0",
"node-rsa": "= 0.4.2",
"rimraf": "= 2.6.1"
}
}
## Instruction:
Add the private flag to interoperability to avoid being a complete numpty.
## Code After:
{
"private": true,
"license": "MIT",
"description": "interoperability tests with AWS SDK for Java",
"repository": {
"type": "git",
"url": "git://github.com/SaltwaterC/envelope-encryption-tools.git"
},
"dependencies": {
"aws-sdk": "= 2.106.0",
"node-rsa": "= 0.4.2",
"rimraf": "= 2.6.1"
}
}
| {
+ "private": true,
"license": "MIT",
"description": "interoperability tests with AWS SDK for Java",
"repository": {
"type": "git",
"url": "git://github.com/SaltwaterC/envelope-encryption-tools.git"
},
"dependencies": {
"aws-sdk": "= 2.106.0",
"node-rsa": "= 0.4.2",
"rimraf": "= 2.6.1"
}
} | 1 | 0.076923 | 1 | 0 |
c957fca27c2f6243aba528e31b98c6bc65b20178 | lib/rack/oauth2/models/active_record.rb | lib/rack/oauth2/models/active_record.rb | module Rack
module OAuth2
class Server
module ActiveRecordExt
def table_name
"oauth2_provider_#{name.split("::").last.underscore}"
end
end
class << self
# Create new instance of the klass and populate its attributes.
def new_instance(klass, fields)
instance = klass.new fields
end
end
end
end
end
require "rack/oauth2/models/active_record/client"
require "rack/oauth2/models/active_record/auth_request"
require "rack/oauth2/models/active_record/access_grant"
require "rack/oauth2/models/active_record/access_token"
require "rack/oauth2/models/active_record/issuer"
| module Rack
module OAuth2
class Server
module ActiveRecordExt
def table_name
"oauth2_provider_#{name.split("::").last.underscore}"
end
def self.extended(mod)
mod.attr_protected if mod.respond_to?(:attr_protected) # protect nothing
end
end
class << self
# Create new instance of the klass and populate its attributes.
def new_instance(klass, fields)
instance = klass.new fields
end
end
end
end
end
require "rack/oauth2/models/active_record/client"
require "rack/oauth2/models/active_record/auth_request"
require "rack/oauth2/models/active_record/access_grant"
require "rack/oauth2/models/active_record/access_token"
require "rack/oauth2/models/active_record/issuer"
| Add blank attrib blacklist if protected_attributes gem is in use | Add blank attrib blacklist if protected_attributes gem is in use
| Ruby | mit | theplant/rack-oauth2-server,theplant/rack-oauth2-server,theplant/rack-oauth2-server | ruby | ## Code Before:
module Rack
module OAuth2
class Server
module ActiveRecordExt
def table_name
"oauth2_provider_#{name.split("::").last.underscore}"
end
end
class << self
# Create new instance of the klass and populate its attributes.
def new_instance(klass, fields)
instance = klass.new fields
end
end
end
end
end
require "rack/oauth2/models/active_record/client"
require "rack/oauth2/models/active_record/auth_request"
require "rack/oauth2/models/active_record/access_grant"
require "rack/oauth2/models/active_record/access_token"
require "rack/oauth2/models/active_record/issuer"
## Instruction:
Add blank attrib blacklist if protected_attributes gem is in use
## Code After:
module Rack
module OAuth2
class Server
module ActiveRecordExt
def table_name
"oauth2_provider_#{name.split("::").last.underscore}"
end
def self.extended(mod)
mod.attr_protected if mod.respond_to?(:attr_protected) # protect nothing
end
end
class << self
# Create new instance of the klass and populate its attributes.
def new_instance(klass, fields)
instance = klass.new fields
end
end
end
end
end
require "rack/oauth2/models/active_record/client"
require "rack/oauth2/models/active_record/auth_request"
require "rack/oauth2/models/active_record/access_grant"
require "rack/oauth2/models/active_record/access_token"
require "rack/oauth2/models/active_record/issuer"
| module Rack
module OAuth2
class Server
module ActiveRecordExt
def table_name
"oauth2_provider_#{name.split("::").last.underscore}"
+ end
+
+ def self.extended(mod)
+ mod.attr_protected if mod.respond_to?(:attr_protected) # protect nothing
end
end
class << self
# Create new instance of the klass and populate its attributes.
def new_instance(klass, fields)
instance = klass.new fields
end
end
end
end
end
require "rack/oauth2/models/active_record/client"
require "rack/oauth2/models/active_record/auth_request"
require "rack/oauth2/models/active_record/access_grant"
require "rack/oauth2/models/active_record/access_token"
require "rack/oauth2/models/active_record/issuer" | 4 | 0.148148 | 4 | 0 |
f5c6adadf754c3507b0e2743a86bde4bba56f3ce | test/TestIOMidi/tst_iomidi.cpp | test/TestIOMidi/tst_iomidi.cpp |
class TestIOMIdi : public QObject
{
Q_OBJECT
private slots:
void test_handle();
void test_clientId();
void test_portId();
private:
IOMidi io;
};
void TestIOMIdi::test_handle()
{
snd_seq_t* seq = io.handle();
QVERIFY(seq);
snd_seq_client_info_t *info;
snd_seq_client_info_alloca(&info);
QCOMPARE(snd_seq_get_client_info(seq, info), 0);
QVERIFY(!QString(snd_seq_client_info_get_name(info)).isNull());
}
void TestIOMIdi::test_clientId()
{
QVERIFY(io.clientId() > 0);
}
void TestIOMIdi::test_portId()
{
QVERIFY(io.clientId() > 0);
}
QTEST_APPLESS_MAIN(TestIOMIdi)
#include "tst_iomidi.moc"
|
class TestIOMIdi : public QObject
{
Q_OBJECT
private slots:
void initTestCase();
void test_handle();
void test_clientId();
void test_portId();
private:
IOMidi* io;
};
void TestIOMIdi::initTestCase() {
io = nullptr;
try {
io = new IOMidi(this);
}
catch (const std::exception&) {
}
}
void TestIOMIdi::test_handle()
{
if (!io) {
return;
}
snd_seq_t* seq = io->handle();
QVERIFY(seq);
snd_seq_client_info_t *info;
snd_seq_client_info_alloca(&info);
QCOMPARE(snd_seq_get_client_info(seq, info), 0);
QVERIFY(!QString(snd_seq_client_info_get_name(info)).isNull());
}
void TestIOMIdi::test_clientId()
{
if (!io) {
return;
}
QVERIFY(io->clientId() > 0);
}
void TestIOMIdi::test_portId()
{
if (!io) {
return;
}
QVERIFY(io->clientId() > 0);
}
QTEST_APPLESS_MAIN(TestIOMIdi)
#include "tst_iomidi.moc"
| Fix breaking tests when sequencer can not be opened | Fix breaking tests when sequencer can not be opened
| C++ | mit | charlesfleche/lpd8-editor,charlesfleche/lpd8-editor | c++ | ## Code Before:
class TestIOMIdi : public QObject
{
Q_OBJECT
private slots:
void test_handle();
void test_clientId();
void test_portId();
private:
IOMidi io;
};
void TestIOMIdi::test_handle()
{
snd_seq_t* seq = io.handle();
QVERIFY(seq);
snd_seq_client_info_t *info;
snd_seq_client_info_alloca(&info);
QCOMPARE(snd_seq_get_client_info(seq, info), 0);
QVERIFY(!QString(snd_seq_client_info_get_name(info)).isNull());
}
void TestIOMIdi::test_clientId()
{
QVERIFY(io.clientId() > 0);
}
void TestIOMIdi::test_portId()
{
QVERIFY(io.clientId() > 0);
}
QTEST_APPLESS_MAIN(TestIOMIdi)
#include "tst_iomidi.moc"
## Instruction:
Fix breaking tests when sequencer can not be opened
## Code After:
class TestIOMIdi : public QObject
{
Q_OBJECT
private slots:
void initTestCase();
void test_handle();
void test_clientId();
void test_portId();
private:
IOMidi* io;
};
void TestIOMIdi::initTestCase() {
io = nullptr;
try {
io = new IOMidi(this);
}
catch (const std::exception&) {
}
}
void TestIOMIdi::test_handle()
{
if (!io) {
return;
}
snd_seq_t* seq = io->handle();
QVERIFY(seq);
snd_seq_client_info_t *info;
snd_seq_client_info_alloca(&info);
QCOMPARE(snd_seq_get_client_info(seq, info), 0);
QVERIFY(!QString(snd_seq_client_info_get_name(info)).isNull());
}
void TestIOMIdi::test_clientId()
{
if (!io) {
return;
}
QVERIFY(io->clientId() > 0);
}
void TestIOMIdi::test_portId()
{
if (!io) {
return;
}
QVERIFY(io->clientId() > 0);
}
QTEST_APPLESS_MAIN(TestIOMIdi)
#include "tst_iomidi.moc"
|
class TestIOMIdi : public QObject
{
Q_OBJECT
private slots:
+ void initTestCase();
+
void test_handle();
void test_clientId();
void test_portId();
private:
- IOMidi io;
+ IOMidi* io;
? +
};
+
+ void TestIOMIdi::initTestCase() {
+ io = nullptr;
+ try {
+ io = new IOMidi(this);
+ }
+ catch (const std::exception&) {
+ }
+ }
void TestIOMIdi::test_handle()
{
+ if (!io) {
+ return;
+ }
+
- snd_seq_t* seq = io.handle();
? ^
+ snd_seq_t* seq = io->handle();
? ^^
QVERIFY(seq);
snd_seq_client_info_t *info;
snd_seq_client_info_alloca(&info);
QCOMPARE(snd_seq_get_client_info(seq, info), 0);
QVERIFY(!QString(snd_seq_client_info_get_name(info)).isNull());
}
void TestIOMIdi::test_clientId()
{
+ if (!io) {
+ return;
+ }
+
- QVERIFY(io.clientId() > 0);
? ^
+ QVERIFY(io->clientId() > 0);
? ^^
}
void TestIOMIdi::test_portId()
{
+ if (!io) {
+ return;
+ }
+
- QVERIFY(io.clientId() > 0);
? ^
+ QVERIFY(io->clientId() > 0);
? ^^
}
QTEST_APPLESS_MAIN(TestIOMIdi)
#include "tst_iomidi.moc" | 31 | 0.815789 | 27 | 4 |
f394bda5216c729fcd7762a0a505191c67da2d43 | app/controllers/hosts_controller.rb | app/controllers/hosts_controller.rb | class HostsController < ActionController::Base
def index
@hosts = Host.all
render json: HostsPresenter.new(@hosts).as_hash.to_json
end
end
| class HostsController < ActionController::Base
def index
@hosts = Host.all.order(:hostname)
render json: HostsPresenter.new(@hosts).as_hash.to_json
end
end
| Order the hosts API output based on the hostname, A-Z | Order the hosts API output based on the hostname, A-Z
| Ruby | mit | alphagov/transition,alphagov/transition,alphagov/transition | ruby | ## Code Before:
class HostsController < ActionController::Base
def index
@hosts = Host.all
render json: HostsPresenter.new(@hosts).as_hash.to_json
end
end
## Instruction:
Order the hosts API output based on the hostname, A-Z
## Code After:
class HostsController < ActionController::Base
def index
@hosts = Host.all.order(:hostname)
render json: HostsPresenter.new(@hosts).as_hash.to_json
end
end
| class HostsController < ActionController::Base
def index
- @hosts = Host.all
+ @hosts = Host.all.order(:hostname)
render json: HostsPresenter.new(@hosts).as_hash.to_json
end
end | 2 | 0.285714 | 1 | 1 |
ad0dc287acc700e2eddd16b42139c131475835b5 | src/packages/database/pool/pool.ts | src/packages/database/pool/pool.ts | /*
* This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.
* License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
*/
import {
pghost as host,
pguser as user,
pgdatabase as database,
} from "@cocalc/backend/data";
import dbPassword from "./password";
export * from "./util";
import /*getCachedPool, */{ Length } from "./cached";
import { Pool } from "pg";
let pool: Pool | undefined = undefined;
export default function getPool(cacheLength?: Length): Pool {
// temporarily disabling all caching, since there is an issue.
// if (cacheLength != null) {
// return getCachedPool(cacheLength);
// }
cacheLength = cacheLength;
if (pool == null) {
pool = new Pool({ password: dbPassword(), user, host, database });
}
return pool;
}
| /*
* This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.
* License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
*/
import {
pghost as host,
pguser as user,
pgdatabase as database,
} from "@cocalc/backend/data";
import dbPassword from "./password";
export * from "./util";
import getCachedPool, { Length } from "./cached";
import { Pool } from "pg";
let pool: Pool | undefined = undefined;
export default function getPool(cacheLength?: Length): Pool {
if (cacheLength != null) {
return getCachedPool(cacheLength);
}
if (pool == null) {
pool = new Pool({ password: dbPassword(), user, host, database });
}
return pool;
}
| Revert "temporarily disable certain database caching used by next app" | Revert "temporarily disable certain database caching used by next app"
This reverts commit dfe98248abcc04413e3d2ab1e2c662f35c6a4bba.
| TypeScript | agpl-3.0 | sagemathinc/smc,sagemathinc/smc,sagemathinc/smc,sagemathinc/smc | typescript | ## Code Before:
/*
* This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.
* License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
*/
import {
pghost as host,
pguser as user,
pgdatabase as database,
} from "@cocalc/backend/data";
import dbPassword from "./password";
export * from "./util";
import /*getCachedPool, */{ Length } from "./cached";
import { Pool } from "pg";
let pool: Pool | undefined = undefined;
export default function getPool(cacheLength?: Length): Pool {
// temporarily disabling all caching, since there is an issue.
// if (cacheLength != null) {
// return getCachedPool(cacheLength);
// }
cacheLength = cacheLength;
if (pool == null) {
pool = new Pool({ password: dbPassword(), user, host, database });
}
return pool;
}
## Instruction:
Revert "temporarily disable certain database caching used by next app"
This reverts commit dfe98248abcc04413e3d2ab1e2c662f35c6a4bba.
## Code After:
/*
* This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.
* License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
*/
import {
pghost as host,
pguser as user,
pgdatabase as database,
} from "@cocalc/backend/data";
import dbPassword from "./password";
export * from "./util";
import getCachedPool, { Length } from "./cached";
import { Pool } from "pg";
let pool: Pool | undefined = undefined;
export default function getPool(cacheLength?: Length): Pool {
if (cacheLength != null) {
return getCachedPool(cacheLength);
}
if (pool == null) {
pool = new Pool({ password: dbPassword(), user, host, database });
}
return pool;
}
| /*
* This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.
* License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
*/
import {
pghost as host,
pguser as user,
pgdatabase as database,
} from "@cocalc/backend/data";
import dbPassword from "./password";
export * from "./util";
- import /*getCachedPool, */{ Length } from "./cached";
? -- --
+ import getCachedPool, { Length } from "./cached";
import { Pool } from "pg";
let pool: Pool | undefined = undefined;
export default function getPool(cacheLength?: Length): Pool {
- // temporarily disabling all caching, since there is an issue.
- // if (cacheLength != null) {
? -----
+ if (cacheLength != null) {
- // return getCachedPool(cacheLength);
? -----
+ return getCachedPool(cacheLength);
+ }
- // }
- cacheLength = cacheLength;
if (pool == null) {
pool = new Pool({ password: dbPassword(), user, host, database });
}
return pool;
} | 10 | 0.357143 | 4 | 6 |
b4220ee7fcf5b3d38bdac9052d892522627395c1 | test/helpers.coffee | test/helpers.coffee | rewire = require 'rewire'
helpers = rewire '../src/helpers'
describe 'helpers', ->
describe 'replaceConfigSlashes()', ->
it 'should replace slashes with backslashes in config', ->
helpers.__set__ 'isWindows', true
unix = require './fixtures/unix_config'
win = require './fixtures/win_config'
expect(helpers.replaceConfigSlashes unix.config).to.eql win.config
| rewire = require 'rewire'
helpers = rewire '../src/helpers'
describe 'helpers', ->
describe 'replaceConfigSlashes()', ->
it 'should replace slashes with backslashes in config', ->
helpers.__set__ 'isWindows', true
unix = require './fixtures/unix_config'
win = require './fixtures/win_config'
expect(helpers.replaceConfigSlashes unix.config).to.eql win.config
describe 'applyOverrides()', ->
applyOverrides = helpers.__get__ 'applyOverrides'
it 'should resolve plugins.on|off merge', ->
config =
plugins:
on: ['a']
off: ['b']
overrides:
foo:
plugins:
on: ['b']
bar:
plugins:
off: ['a']
baz:
plugins:
on: ['c']
applyOverrides config, env: ['foo', 'bar', 'baz']
expect(config.plugins).to.eql {on: ['c', 'b'], off: ['a']}
| Add test for plugins.on|off overrides | Add test for plugins.on|off overrides
| CoffeeScript | mit | hayesgm/brunch,rlugojr/brunch,Flaise/brunch,ondreian/brunch,kidaa/brunch,lalomartins/brunch,hellyeahllc/brunch,brunch/brunch,PeterDaveHello/brunch,justinwoo/brunch | coffeescript | ## Code Before:
rewire = require 'rewire'
helpers = rewire '../src/helpers'
describe 'helpers', ->
describe 'replaceConfigSlashes()', ->
it 'should replace slashes with backslashes in config', ->
helpers.__set__ 'isWindows', true
unix = require './fixtures/unix_config'
win = require './fixtures/win_config'
expect(helpers.replaceConfigSlashes unix.config).to.eql win.config
## Instruction:
Add test for plugins.on|off overrides
## Code After:
rewire = require 'rewire'
helpers = rewire '../src/helpers'
describe 'helpers', ->
describe 'replaceConfigSlashes()', ->
it 'should replace slashes with backslashes in config', ->
helpers.__set__ 'isWindows', true
unix = require './fixtures/unix_config'
win = require './fixtures/win_config'
expect(helpers.replaceConfigSlashes unix.config).to.eql win.config
describe 'applyOverrides()', ->
applyOverrides = helpers.__get__ 'applyOverrides'
it 'should resolve plugins.on|off merge', ->
config =
plugins:
on: ['a']
off: ['b']
overrides:
foo:
plugins:
on: ['b']
bar:
plugins:
off: ['a']
baz:
plugins:
on: ['c']
applyOverrides config, env: ['foo', 'bar', 'baz']
expect(config.plugins).to.eql {on: ['c', 'b'], off: ['a']}
| rewire = require 'rewire'
helpers = rewire '../src/helpers'
describe 'helpers', ->
describe 'replaceConfigSlashes()', ->
it 'should replace slashes with backslashes in config', ->
helpers.__set__ 'isWindows', true
unix = require './fixtures/unix_config'
win = require './fixtures/win_config'
expect(helpers.replaceConfigSlashes unix.config).to.eql win.config
+
+ describe 'applyOverrides()', ->
+ applyOverrides = helpers.__get__ 'applyOverrides'
+
+ it 'should resolve plugins.on|off merge', ->
+ config =
+ plugins:
+ on: ['a']
+ off: ['b']
+ overrides:
+ foo:
+ plugins:
+ on: ['b']
+ bar:
+ plugins:
+ off: ['a']
+ baz:
+ plugins:
+ on: ['c']
+
+ applyOverrides config, env: ['foo', 'bar', 'baz']
+ expect(config.plugins).to.eql {on: ['c', 'b'], off: ['a']} | 22 | 2.2 | 22 | 0 |
037e215ad18004477a927579e40c1a7a43f4ea6c | templates/etc/diamond/collectors/collector.conf.erb | templates/etc/diamond/collectors/collector.conf.erb | enabled=True
<% if defined?(@options) -%>
<% @options.each do |k,v| -%>
<%= "#{k}=#{v}" %>
<% end -%>
<% end -%>
| enabled=True
<% if defined?(@options) -%>
<% @options.keys.sort.each do |k| -%>
<%= "#{k}=#{@options[k]}" %>
<% end -%>
<% end -%>
| Sort collector parameters by name. | Sort collector parameters by name.
Otherwise you can end up in a situation where you continually re-write the collector config
as hash ordering is random. This makes the generated files predictable and idempotent
| HTML+ERB | apache-2.0 | xaque208/garethr-diamond,jaxxstorm/garethr-diamond,adrienthebo/garethr-diamond,puppetlabs-operations/garethr-diamond,xaque208/garethr-diamond,puppetlabs-operations/garethr-diamond,adrienthebo/garethr-diamond,fasrc/garethr-diamond,puppetlabs-operations/garethr-diamond,nexjhealth/garethr-diamond,jaxxstorm/garethr-diamond,xaque208/garethr-diamond,adrienthebo/garethr-diamond,garethr/garethr-diamond,Yelp/garethr-diamond,Yelp/garethr-diamond,fasrc/garethr-diamond,garethr/garethr-diamond,fasrc/garethr-diamond,jaxxstorm/garethr-diamond,garethr/garethr-diamond,Yelp/garethr-diamond | html+erb | ## Code Before:
enabled=True
<% if defined?(@options) -%>
<% @options.each do |k,v| -%>
<%= "#{k}=#{v}" %>
<% end -%>
<% end -%>
## Instruction:
Sort collector parameters by name.
Otherwise you can end up in a situation where you continually re-write the collector config
as hash ordering is random. This makes the generated files predictable and idempotent
## Code After:
enabled=True
<% if defined?(@options) -%>
<% @options.keys.sort.each do |k| -%>
<%= "#{k}=#{@options[k]}" %>
<% end -%>
<% end -%>
| enabled=True
<% if defined?(@options) -%>
- <% @options.each do |k,v| -%>
? --
+ <% @options.keys.sort.each do |k| -%>
? ++++++++++
- <%= "#{k}=#{v}" %>
? ^
+ <%= "#{k}=#{@options[k]}" %>
? ^^^^^^^^^^^
<% end -%>
<% end -%>
+ | 5 | 0.833333 | 3 | 2 |
718ca3e9619b9b9c9514acae5bd21dc8ba7d7d72 | .travis.yml | .travis.yml | language: rust
sudo: false
matrix:
include:
- rust: 1.12.0
env:
- ALL=' '
- rust: stable
env:
- FEATURES='unstable quickcheck'
- rust: beta
- rust: nightly
- rust: nightly
env:
- FEATURES='unstable quickcheck'
- BENCH=1
branches:
only:
- master
script:
- |
cargo build --verbose --no-default-features &&
cargo test --verbose --no-default-features &&
cargo build --verbose --features "$FEATURES" &&
cargo test ${ALL:---all} --verbose --features "$FEATURES"
| language: rust
sudo: false
matrix:
include:
- rust: 1.12.0
before_script:
# rand 0.4.2 requires rust 1.15, and rand-0.3.22 requires rand-0.4 :/
# manually hacking the lockfile due to the limitations of cargo#2773
- cargo generate-lockfile
- sed -i -e 's/"rand 0.[34].[0-9]\+/"rand 0.3.20/' Cargo.lock
- sed -i -e '/^name = "rand"/,/^$/s/version = "0.3.[0-9]\+"/version = "0.3.20"/' Cargo.lock
env:
- ALL=' '
- rust: 1.15.0
- rust: stable
env:
- FEATURES='unstable quickcheck'
- rust: beta
- rust: nightly
- rust: nightly
env:
- FEATURES='unstable quickcheck'
- BENCH=1
branches:
only:
- master
script:
- |
cargo build --verbose --no-default-features &&
cargo test --verbose --no-default-features &&
cargo build --verbose --features "$FEATURES" &&
cargo test ${ALL:---all} --verbose --features "$FEATURES"
| Fix testing on Rust 1.12 using cuviper's trick again | MAINT: Fix testing on Rust 1.12 using cuviper's trick again
As seen in rayon and itertools
| YAML | apache-2.0 | bluss/petulant-avenger-graphlibrary,petgraph/petgraph | yaml | ## Code Before:
language: rust
sudo: false
matrix:
include:
- rust: 1.12.0
env:
- ALL=' '
- rust: stable
env:
- FEATURES='unstable quickcheck'
- rust: beta
- rust: nightly
- rust: nightly
env:
- FEATURES='unstable quickcheck'
- BENCH=1
branches:
only:
- master
script:
- |
cargo build --verbose --no-default-features &&
cargo test --verbose --no-default-features &&
cargo build --verbose --features "$FEATURES" &&
cargo test ${ALL:---all} --verbose --features "$FEATURES"
## Instruction:
MAINT: Fix testing on Rust 1.12 using cuviper's trick again
As seen in rayon and itertools
## Code After:
language: rust
sudo: false
matrix:
include:
- rust: 1.12.0
before_script:
# rand 0.4.2 requires rust 1.15, and rand-0.3.22 requires rand-0.4 :/
# manually hacking the lockfile due to the limitations of cargo#2773
- cargo generate-lockfile
- sed -i -e 's/"rand 0.[34].[0-9]\+/"rand 0.3.20/' Cargo.lock
- sed -i -e '/^name = "rand"/,/^$/s/version = "0.3.[0-9]\+"/version = "0.3.20"/' Cargo.lock
env:
- ALL=' '
- rust: 1.15.0
- rust: stable
env:
- FEATURES='unstable quickcheck'
- rust: beta
- rust: nightly
- rust: nightly
env:
- FEATURES='unstable quickcheck'
- BENCH=1
branches:
only:
- master
script:
- |
cargo build --verbose --no-default-features &&
cargo test --verbose --no-default-features &&
cargo build --verbose --features "$FEATURES" &&
cargo test ${ALL:---all} --verbose --features "$FEATURES"
| language: rust
sudo: false
matrix:
include:
- rust: 1.12.0
+ before_script:
+ # rand 0.4.2 requires rust 1.15, and rand-0.3.22 requires rand-0.4 :/
+ # manually hacking the lockfile due to the limitations of cargo#2773
+ - cargo generate-lockfile
+ - sed -i -e 's/"rand 0.[34].[0-9]\+/"rand 0.3.20/' Cargo.lock
+ - sed -i -e '/^name = "rand"/,/^$/s/version = "0.3.[0-9]\+"/version = "0.3.20"/' Cargo.lock
env:
- ALL=' '
+ - rust: 1.15.0
- rust: stable
env:
- FEATURES='unstable quickcheck'
- rust: beta
- rust: nightly
- rust: nightly
env:
- FEATURES='unstable quickcheck'
- BENCH=1
branches:
only:
- master
script:
- |
cargo build --verbose --no-default-features &&
cargo test --verbose --no-default-features &&
cargo build --verbose --features "$FEATURES" &&
cargo test ${ALL:---all} --verbose --features "$FEATURES" | 7 | 0.28 | 7 | 0 |
f0ecb56935c9497f5e9e7564f7f658598bd85d53 | tox.ini | tox.ini | [flake8]
max-line-length=100
| [flake8]
max-line-length=100
exclude=libevent-2.0.21-stable/*,transmission-2.84/*
| Make flake8 ignore libevent/transmission sources. | Make flake8 ignore libevent/transmission sources.
| INI | mit | karamanolev/WhatManager2,davols/WhatManager2,MADindustries/WhatManager2,karamanolev/WhatManager2,MADindustries/WhatManager2,davols/WhatManager2,grandmasterchef/WhatManager2,davols/WhatManager2,grandmasterchef/WhatManager2,karamanolev/WhatManager2,grandmasterchef/WhatManager2,karamanolev/WhatManager2,MADindustries/WhatManager2,MADindustries/WhatManager2,grandmasterchef/WhatManager2 | ini | ## Code Before:
[flake8]
max-line-length=100
## Instruction:
Make flake8 ignore libevent/transmission sources.
## Code After:
[flake8]
max-line-length=100
exclude=libevent-2.0.21-stable/*,transmission-2.84/*
| [flake8]
max-line-length=100
+ exclude=libevent-2.0.21-stable/*,transmission-2.84/* | 1 | 0.5 | 1 | 0 |
f390a10385b002d1903d068c0fcba4694b512171 | README.md | README.md | fuds
====

File Uploading and Downloading Service
| fuds
====
[](https://travis-ci.org/jcaraballo/fuds)
File Uploading and Downloading Service
| Make Travis badge link to fuds in Travis | Make Travis badge link to fuds in Travis | Markdown | apache-2.0 | jcaraballo/fuds | markdown | ## Code Before:
fuds
====

File Uploading and Downloading Service
## Instruction:
Make Travis badge link to fuds in Travis
## Code After:
fuds
====
[](https://travis-ci.org/jcaraballo/fuds)
File Uploading and Downloading Service
| fuds
====
- 
+ [](https://travis-ci.org/jcaraballo/fuds)
? + ++++++++++++++++++++++++++++++++++++++++
File Uploading and Downloading Service | 2 | 0.333333 | 1 | 1 |
e16516e2988c202a72383f33250c1a1596300ee6 | kspRemoteTechPlanner/app.css | kspRemoteTechPlanner/app.css | div.wrap-canvas {
display: inline-block;
border-style: solid;
border-width: thin;
}
div.manual-input {
margin: 5%;
display: none;
}
button.manual-input[id$="detail"] {
width: 10%;
}
| div.wrap-canvas {
display: inline-block;
border-style: solid;
border-width: thin;
}
div.manual-input {
margin: 5%;
display: none;
}
button.manual-input[id$="_detail"] {
width: 90%;
}
button.manual-input[id$="_reset"] {
width: 10%;
}
| Fix button style, checked with IE and chrome. | Fix button style, checked with IE and chrome.
| CSS | mit | ryohpops/kspRemoteTechPlanner,ryohpops/kspRemoteTechPlanner,ryohpops/kspRemoteTechPlanner | css | ## Code Before:
div.wrap-canvas {
display: inline-block;
border-style: solid;
border-width: thin;
}
div.manual-input {
margin: 5%;
display: none;
}
button.manual-input[id$="detail"] {
width: 10%;
}
## Instruction:
Fix button style, checked with IE and chrome.
## Code After:
div.wrap-canvas {
display: inline-block;
border-style: solid;
border-width: thin;
}
div.manual-input {
margin: 5%;
display: none;
}
button.manual-input[id$="_detail"] {
width: 90%;
}
button.manual-input[id$="_reset"] {
width: 10%;
}
| div.wrap-canvas {
display: inline-block;
border-style: solid;
border-width: thin;
}
div.manual-input {
margin: 5%;
display: none;
}
- button.manual-input[id$="detail"] {
+ button.manual-input[id$="_detail"] {
? +
+ width: 90%;
+ }
+
+ button.manual-input[id$="_reset"] {
width: 10%;
} | 6 | 0.428571 | 5 | 1 |
7cc6a3b67db793303df5ab8e10cc1a232b7d5f27 | .travis.yml | .travis.yml | language: php
sudo: false
matrix:
include:
- php: 5.5
env: TEST_SUITE="Unit Test Suite"
- php: 5.6
env: TEST_SUITE="Unit Test Suite"
- php: 7.0
env: TEST_SUITE="Unit Test Suite"
- php: 7.1
env: TEST_SUITE="Unit Test Suite" COLLECT_COVERAGE=true
- php: 7.1
env: TEST_SUITE="Integration Test Suite"
allow_failures:
- php: 7.1
env: TEST_SUITE="Integration Test Suite"
before_script:
- travis_retry composer install --no-interaction
script:
- vendor/bin/phpunit --testsuite "$TEST_SUITE"
after_script:
- if [[ "$COLLECT_COVERAGE" == "true" ]]; then vendor/bin/coveralls; fi
| language: php
sudo: false
matrix:
include:
- php: 5.5
env: TEST_SUITE="Unit Test Suite"
- php: 5.6
env: TEST_SUITE="Unit Test Suite"
- php: 7.0
env: TEST_SUITE="Unit Test Suite"
- php: 7.1
env: TEST_SUITE="Unit Test Suite"
- php: 7.2
env: TEST_SUITE="Unit Test Suite" COLLECT_COVERAGE=true
- php: 7.2
env: TEST_SUITE="Integration Test Suite"
allow_failures:
- php: 7.2
env: TEST_SUITE="Integration Test Suite"
before_script:
- travis_retry composer install --no-interaction
script:
- vendor/bin/phpunit --testsuite "$TEST_SUITE"
after_script:
- if [[ "$COLLECT_COVERAGE" == "true" ]]; then vendor/bin/coveralls; fi
| Add 7.2 to build targets | Add 7.2 to build targets | YAML | bsd-3-clause | GetStream/stream-php,GetStream/stream-php | yaml | ## Code Before:
language: php
sudo: false
matrix:
include:
- php: 5.5
env: TEST_SUITE="Unit Test Suite"
- php: 5.6
env: TEST_SUITE="Unit Test Suite"
- php: 7.0
env: TEST_SUITE="Unit Test Suite"
- php: 7.1
env: TEST_SUITE="Unit Test Suite" COLLECT_COVERAGE=true
- php: 7.1
env: TEST_SUITE="Integration Test Suite"
allow_failures:
- php: 7.1
env: TEST_SUITE="Integration Test Suite"
before_script:
- travis_retry composer install --no-interaction
script:
- vendor/bin/phpunit --testsuite "$TEST_SUITE"
after_script:
- if [[ "$COLLECT_COVERAGE" == "true" ]]; then vendor/bin/coveralls; fi
## Instruction:
Add 7.2 to build targets
## Code After:
language: php
sudo: false
matrix:
include:
- php: 5.5
env: TEST_SUITE="Unit Test Suite"
- php: 5.6
env: TEST_SUITE="Unit Test Suite"
- php: 7.0
env: TEST_SUITE="Unit Test Suite"
- php: 7.1
env: TEST_SUITE="Unit Test Suite"
- php: 7.2
env: TEST_SUITE="Unit Test Suite" COLLECT_COVERAGE=true
- php: 7.2
env: TEST_SUITE="Integration Test Suite"
allow_failures:
- php: 7.2
env: TEST_SUITE="Integration Test Suite"
before_script:
- travis_retry composer install --no-interaction
script:
- vendor/bin/phpunit --testsuite "$TEST_SUITE"
after_script:
- if [[ "$COLLECT_COVERAGE" == "true" ]]; then vendor/bin/coveralls; fi
| language: php
sudo: false
matrix:
include:
- php: 5.5
env: TEST_SUITE="Unit Test Suite"
- php: 5.6
env: TEST_SUITE="Unit Test Suite"
- php: 7.0
env: TEST_SUITE="Unit Test Suite"
- php: 7.1
+ env: TEST_SUITE="Unit Test Suite"
+ - php: 7.2
env: TEST_SUITE="Unit Test Suite" COLLECT_COVERAGE=true
- - php: 7.1
? ^
+ - php: 7.2
? ^
env: TEST_SUITE="Integration Test Suite"
allow_failures:
- - php: 7.1
? ^
+ - php: 7.2
? ^
env: TEST_SUITE="Integration Test Suite"
before_script:
- travis_retry composer install --no-interaction
script:
- vendor/bin/phpunit --testsuite "$TEST_SUITE"
after_script:
- if [[ "$COLLECT_COVERAGE" == "true" ]]; then vendor/bin/coveralls; fi | 6 | 0.24 | 4 | 2 |
fae49e9d1373273f428a1e3aea5ad6a5a1fd53d5 | us_ignite/templates/hubs/object_detail.html | us_ignite/templates/hubs/object_detail.html | {% extends "includes/lists/object_detail_base.html" %}{% load apps_urls thumbnail common_markdown %}
{% block title %}Community {{ object.name }} - {{ block.super }}{% endblock title %}
{% block tag_list %}
{% include "includes/tag_list.html" with tag_list=object.tags.all tag_type="search_hubs" %}
{% endblock tag_list %}
| {% extends "includes/lists/object_detail_base.html" %}{% load apps_urls thumbnail common_markdown %}
{% block title %}Community {{ object.name }} - {{ block.super }}{% endblock title %}
{% block tag_list %}
{% include "includes/tag_list.html" with tag_list=object.tags.all tag_type="search_hubs" %}
{% endblock tag_list %}
{# Intro content (metadata) #}
{% block intro %}
<li>Created: {{ object.created }}</li>
{% if is_contact %}<li><a href="{{ object.get_edit_url }}">Edit community</a></li>{% endif %}
{% if object.organization %}<li>Organization: <a href="{{ object.organization.get_absolute_url }}">{{ object.organization.name }}</a></li>{% endif %}
{% if object.network_speed %}<li>Network Speed: {{ object.network_speed.name }}</li>{% endif %}
{% if object.is_advanced %}<li>Community has advanced characteristics</li>{% endif %}
{% endblock %}
{# Specific Hub content #}
{% block detail_extras %}
{% if object.estimated_passes %}
<h2>Estimated Pases</h2>
<p>{{ object.estimated_passes }}</p>
{% endif %}
{% if object.connections %}
<h2>Connections to other networks</h2>
<p>
{{ object.connections }}
</p>
{% endif %}
{% if event_list %}
<h2>Upcoming events</h2>
<ul>
{% for event in event_list %}
<li><a href="{{ event.get_absolute_url }}">{{ event.name }}</a> on {{ event.start_datetime }}</li>
{% endfor%}
</ul>
{% endif %}
{% with object.applications.all as app_list %}
{% if app_list %}
<h2>Piloted applications</h2>
<ul>
{% for app in app_list %}
<li><a href="{{ app.get_absolute_url }}">{{ app.name }}</a></li>
{% endfor%}
</ul>
{% endif %}
{% endwith %}
{% endblock detail_extras %}
| Increase the details surfaced in the Hub detail page. | Increase the details surfaced in the Hub detail page.
| HTML | bsd-3-clause | us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite | html | ## Code Before:
{% extends "includes/lists/object_detail_base.html" %}{% load apps_urls thumbnail common_markdown %}
{% block title %}Community {{ object.name }} - {{ block.super }}{% endblock title %}
{% block tag_list %}
{% include "includes/tag_list.html" with tag_list=object.tags.all tag_type="search_hubs" %}
{% endblock tag_list %}
## Instruction:
Increase the details surfaced in the Hub detail page.
## Code After:
{% extends "includes/lists/object_detail_base.html" %}{% load apps_urls thumbnail common_markdown %}
{% block title %}Community {{ object.name }} - {{ block.super }}{% endblock title %}
{% block tag_list %}
{% include "includes/tag_list.html" with tag_list=object.tags.all tag_type="search_hubs" %}
{% endblock tag_list %}
{# Intro content (metadata) #}
{% block intro %}
<li>Created: {{ object.created }}</li>
{% if is_contact %}<li><a href="{{ object.get_edit_url }}">Edit community</a></li>{% endif %}
{% if object.organization %}<li>Organization: <a href="{{ object.organization.get_absolute_url }}">{{ object.organization.name }}</a></li>{% endif %}
{% if object.network_speed %}<li>Network Speed: {{ object.network_speed.name }}</li>{% endif %}
{% if object.is_advanced %}<li>Community has advanced characteristics</li>{% endif %}
{% endblock %}
{# Specific Hub content #}
{% block detail_extras %}
{% if object.estimated_passes %}
<h2>Estimated Pases</h2>
<p>{{ object.estimated_passes }}</p>
{% endif %}
{% if object.connections %}
<h2>Connections to other networks</h2>
<p>
{{ object.connections }}
</p>
{% endif %}
{% if event_list %}
<h2>Upcoming events</h2>
<ul>
{% for event in event_list %}
<li><a href="{{ event.get_absolute_url }}">{{ event.name }}</a> on {{ event.start_datetime }}</li>
{% endfor%}
</ul>
{% endif %}
{% with object.applications.all as app_list %}
{% if app_list %}
<h2>Piloted applications</h2>
<ul>
{% for app in app_list %}
<li><a href="{{ app.get_absolute_url }}">{{ app.name }}</a></li>
{% endfor%}
</ul>
{% endif %}
{% endwith %}
{% endblock detail_extras %}
| {% extends "includes/lists/object_detail_base.html" %}{% load apps_urls thumbnail common_markdown %}
{% block title %}Community {{ object.name }} - {{ block.super }}{% endblock title %}
{% block tag_list %}
{% include "includes/tag_list.html" with tag_list=object.tags.all tag_type="search_hubs" %}
{% endblock tag_list %}
+
+ {# Intro content (metadata) #}
+ {% block intro %}
+ <li>Created: {{ object.created }}</li>
+ {% if is_contact %}<li><a href="{{ object.get_edit_url }}">Edit community</a></li>{% endif %}
+ {% if object.organization %}<li>Organization: <a href="{{ object.organization.get_absolute_url }}">{{ object.organization.name }}</a></li>{% endif %}
+ {% if object.network_speed %}<li>Network Speed: {{ object.network_speed.name }}</li>{% endif %}
+ {% if object.is_advanced %}<li>Community has advanced characteristics</li>{% endif %}
+ {% endblock %}
+
+ {# Specific Hub content #}
+ {% block detail_extras %}
+
+ {% if object.estimated_passes %}
+ <h2>Estimated Pases</h2>
+ <p>{{ object.estimated_passes }}</p>
+ {% endif %}
+
+ {% if object.connections %}
+ <h2>Connections to other networks</h2>
+ <p>
+ {{ object.connections }}
+ </p>
+ {% endif %}
+
+ {% if event_list %}
+ <h2>Upcoming events</h2>
+ <ul>
+ {% for event in event_list %}
+ <li><a href="{{ event.get_absolute_url }}">{{ event.name }}</a> on {{ event.start_datetime }}</li>
+ {% endfor%}
+ </ul>
+ {% endif %}
+
+ {% with object.applications.all as app_list %}
+ {% if app_list %}
+ <h2>Piloted applications</h2>
+ <ul>
+ {% for app in app_list %}
+ <li><a href="{{ app.get_absolute_url }}">{{ app.name }}</a></li>
+ {% endfor%}
+ </ul>
+ {% endif %}
+ {% endwith %}
+ {% endblock detail_extras %} | 45 | 6.428571 | 45 | 0 |
3e19fe0ea99f5e5d8a166a79c37a1d0bf59e22ba | components/productlist/default.htm | components/productlist/default.htm | {% if productList.products|length %}
<div class="row">
{% for product in __SELF__.products %}
<div class="col-sm-6 col-md-3">
{% partial __SELF__ ~ '::item' product=product %}
</div>
{% endfor %}
</div>
{% else %}
<p class="lead text-muted text-center">
No product available.
</p>
{% endif %} | {% if __SELF__.products|length %}
<div class="row">
{% for product in __SELF__.products %}
<div class="col-sm-6 col-md-3">
{% partial __SELF__ ~ '::item' product=product %}
</div>
{% endfor %}
</div>
{% else %}
<p class="lead text-muted text-center">
No product available.
</p>
{% endif %}
| Change call to component name to __SELF__ | Change call to component name to __SELF__
| HTML | mit | octommerce/octommerce,octommerce/octommerce,octommerce/octommerce | html | ## Code Before:
{% if productList.products|length %}
<div class="row">
{% for product in __SELF__.products %}
<div class="col-sm-6 col-md-3">
{% partial __SELF__ ~ '::item' product=product %}
</div>
{% endfor %}
</div>
{% else %}
<p class="lead text-muted text-center">
No product available.
</p>
{% endif %}
## Instruction:
Change call to component name to __SELF__
## Code After:
{% if __SELF__.products|length %}
<div class="row">
{% for product in __SELF__.products %}
<div class="col-sm-6 col-md-3">
{% partial __SELF__ ~ '::item' product=product %}
</div>
{% endfor %}
</div>
{% else %}
<p class="lead text-muted text-center">
No product available.
</p>
{% endif %}
| - {% if productList.products|length %}
? ^^^^^^^ ^^^
+ {% if __SELF__.products|length %}
? ^^^^ ^^^
<div class="row">
{% for product in __SELF__.products %}
<div class="col-sm-6 col-md-3">
{% partial __SELF__ ~ '::item' product=product %}
</div>
{% endfor %}
</div>
{% else %}
<p class="lead text-muted text-center">
No product available.
</p>
{% endif %} | 2 | 0.125 | 1 | 1 |
2004007f0010ad9914385231a6c1a24b2dddfabc | Installation.markdown | Installation.markdown | JSON Framework Installation
===========================
The simplest way to start using the JSON Framework in your iPhone, iPad, or Mac application is to simply copy the JSON sources into your Xcode project.
1. Drag the JSON folder from the distribution.
1. Drop it on the **Classes** group in the **Groups & Files** menu of your Xcode project.
1. Tick the **Copy items into destination group's folder** option.
1. Use `#import "JSON.h"` in your source files.
Upgrading
---------
If you're upgrading from a previous version, make sure you're deleting the old JSON group first, moving all the files to Trash.
Trouble-shooting
----------------
Check to see if the answers to the [Frequently Asked Questions][faq] are of any help.
[faq]: http://github.com/stig/json-framework/wiki/FrequentlyAskedQuestions | Super-simple installation
=========================
By *far* the simplest way to start using JSON in your iPhone, iPad, or Mac application is to simply copy all the source files (the contents of the `Classes` folder) into your own Xcode project.
1. In the Finder, open the `json-framework/Classes` folder and select all the files.
1. Drop-and-drop them on the **Classes** group in the **Groups & Files** menu of your Xcode project.
1. Tick the **Copy items into destination group's folder** option.
1. Use `#import "JSON.h"` in your source files.
That should be it. Now create that Twitter client!
Upgrading
---------
If you're upgrading from a previous version, make sure you're deleting the old JSON classes first, moving all the files to Trash.
Trouble-shooting
----------------
Check to see if the answers to the [Frequently Asked Questions][faq] are of any help.
[faq]: http://github.com/stig/json-framework/wiki/FrequentlyAskedQuestions
Alternative installation instructions
=====================================
Copying the JSON Classes into your project isn't the *only* way to use this framework. I've created a couple of examples that link to this framework rather than copy the sources. Check them out at github:
* [Linking to JSON Framework on the iPhone, iPad & iPod Touch](http://github.com/stig/JsonSampleIPhone)
* [Linking to JSON Framework on the Mac](http://github.com/stig/JsonSampleMac)
| Document how you're meant to be able to use the library; not necessarily how it currently works | Document how you're meant to be able to use the library; not necessarily how it currently works
| Markdown | bsd-3-clause | cnbin/json-framework,AlexanderMazaletskiy/json-framework,hkg36/SBJson_amenmod,adonoho/json-framework,adamvduke/json-framework,duanhjlt/json-framework,sporttech/json-framework,hkg36/SBJson_amenmod,SinnerSchraderMobileMirrors/json-framework,Liaojinghui/json-framework,HSFGitHub/json-framework,0xc010d/json-framework,ramoslin02/json-framework,AbelSu131/json-framework,stig/json-framework,0xc010d/json-framework,puvanarajan/json-framework,adamvduke/json-framework,nett55/json-framework,Jawbone/json-framework | markdown | ## Code Before:
JSON Framework Installation
===========================
The simplest way to start using the JSON Framework in your iPhone, iPad, or Mac application is to simply copy the JSON sources into your Xcode project.
1. Drag the JSON folder from the distribution.
1. Drop it on the **Classes** group in the **Groups & Files** menu of your Xcode project.
1. Tick the **Copy items into destination group's folder** option.
1. Use `#import "JSON.h"` in your source files.
Upgrading
---------
If you're upgrading from a previous version, make sure you're deleting the old JSON group first, moving all the files to Trash.
Trouble-shooting
----------------
Check to see if the answers to the [Frequently Asked Questions][faq] are of any help.
[faq]: http://github.com/stig/json-framework/wiki/FrequentlyAskedQuestions
## Instruction:
Document how you're meant to be able to use the library; not necessarily how it currently works
## Code After:
Super-simple installation
=========================
By *far* the simplest way to start using JSON in your iPhone, iPad, or Mac application is to simply copy all the source files (the contents of the `Classes` folder) into your own Xcode project.
1. In the Finder, open the `json-framework/Classes` folder and select all the files.
1. Drop-and-drop them on the **Classes** group in the **Groups & Files** menu of your Xcode project.
1. Tick the **Copy items into destination group's folder** option.
1. Use `#import "JSON.h"` in your source files.
That should be it. Now create that Twitter client!
Upgrading
---------
If you're upgrading from a previous version, make sure you're deleting the old JSON classes first, moving all the files to Trash.
Trouble-shooting
----------------
Check to see if the answers to the [Frequently Asked Questions][faq] are of any help.
[faq]: http://github.com/stig/json-framework/wiki/FrequentlyAskedQuestions
Alternative installation instructions
=====================================
Copying the JSON Classes into your project isn't the *only* way to use this framework. I've created a couple of examples that link to this framework rather than copy the sources. Check them out at github:
* [Linking to JSON Framework on the iPhone, iPad & iPod Touch](http://github.com/stig/JsonSampleIPhone)
* [Linking to JSON Framework on the Mac](http://github.com/stig/JsonSampleMac)
| - JSON Framework Installation
+ Super-simple installation
- ===========================
? --
+ =========================
- The simplest way to start using the JSON Framework in your iPhone, iPad, or Mac application is to simply copy the JSON sources into your Xcode project.
? ^ ---- ---------- -----
+ By *far* the simplest way to start using JSON in your iPhone, iPad, or Mac application is to simply copy all the source files (the contents of the `Classes` folder) into your own Xcode project.
? ^^^^^^^^^^ ++++ +++++ +++++++++++++++++++++++++++++++++++++++ ++++
- 1. Drag the JSON folder from the distribution.
+ 1. In the Finder, open the `json-framework/Classes` folder and select all the files.
- 1. Drop it on the **Classes** group in the **Groups & Files** menu of your Xcode project.
? -
+ 1. Drop-and-drop them on the **Classes** group in the **Groups & Files** menu of your Xcode project.
? +++++++++ +++
1. Tick the **Copy items into destination group's folder** option.
1. Use `#import "JSON.h"` in your source files.
+
+ That should be it. Now create that Twitter client!
Upgrading
---------
- If you're upgrading from a previous version, make sure you're deleting the old JSON group first, moving all the files to Trash.
? ^^^^^
+ If you're upgrading from a previous version, make sure you're deleting the old JSON classes first, moving all the files to Trash.
? ^^^^^^^
Trouble-shooting
----------------
Check to see if the answers to the [Frequently Asked Questions][faq] are of any help.
[faq]: http://github.com/stig/json-framework/wiki/FrequentlyAskedQuestions
+
+ Alternative installation instructions
+ =====================================
+
+ Copying the JSON Classes into your project isn't the *only* way to use this framework. I've created a couple of examples that link to this framework rather than copy the sources. Check them out at github:
+
+ * [Linking to JSON Framework on the iPhone, iPad & iPod Touch](http://github.com/stig/JsonSampleIPhone)
+ * [Linking to JSON Framework on the Mac](http://github.com/stig/JsonSampleMac)
+ | 23 | 1.15 | 17 | 6 |
01a3fc4df455a839d0c0d999c1f259de97856aa1 | vscode/config.d/keybindings.json | vscode/config.d/keybindings.json | // Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+;",
"command": "workbench.action.terminal.focus"
},
{
"key": "ctrl+'",
"command": "workbench.action.focusActiveEditorGroup"
}
]
| // Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+;",
"command": "workbench.action.terminal.focus"
},
{
"key": "ctrl+'",
"command": "workbench.action.focusActiveEditorGroup"
},
{
"key": "ctrl+enter",
"command": "editor.action.insertLineAfter",
"when": "editorTextFocus && !editorReadonly"
}
]
| Add keybind to ignore completion panel | Add keybind to ignore completion panel
| JSON | mit | himkt/.dotfiles,himkt/.dotfiles,himkt/.dotfiles,himkt/.dotfiles | json | ## Code Before:
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+;",
"command": "workbench.action.terminal.focus"
},
{
"key": "ctrl+'",
"command": "workbench.action.focusActiveEditorGroup"
}
]
## Instruction:
Add keybind to ignore completion panel
## Code After:
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+;",
"command": "workbench.action.terminal.focus"
},
{
"key": "ctrl+'",
"command": "workbench.action.focusActiveEditorGroup"
},
{
"key": "ctrl+enter",
"command": "editor.action.insertLineAfter",
"when": "editorTextFocus && !editorReadonly"
}
]
| // Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+;",
"command": "workbench.action.terminal.focus"
},
{
"key": "ctrl+'",
"command": "workbench.action.focusActiveEditorGroup"
+ },
+ {
+ "key": "ctrl+enter",
+ "command": "editor.action.insertLineAfter",
+ "when": "editorTextFocus && !editorReadonly"
}
] | 5 | 0.454545 | 5 | 0 |
d5727c9dc0a977a4b97b25945face69e53a24482 | spree_slider.gemspec | spree_slider.gemspec | Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'spree_slider'
s.version = '3.2.0.alpha'
s.summary = 'Spree Slider extension'
s.description = 'Adds a slider to the homepage'
s.required_ruby_version = '>= 1.8.7'
s.author = 'Giuseppe Privitera'
s.email = 'priviterag@gmail.com'
s.homepage = 'https://github.com/priviterag/spree_slider'
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.require_path = 'lib'
s.requirements << 'none'
s.add_dependency 'spree_core', '>= 3.2.0.alpha'
s.add_dependency 'spree_backend', '>= 3.2.0.alpha'
end
| Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'spree_slider'
s.version = '3.2.0.alpha'
s.summary = 'Spree Slider extension'
s.description = 'Adds a slider to the homepage'
s.required_ruby_version = '>= 1.8.7'
s.author = 'Giuseppe Privitera'
s.email = 'priviterag@gmail.com'
s.homepage = 'https://github.com/priviterag/spree_slider'
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.require_path = 'lib'
s.requirements << 'none'
s.add_dependency 'spree_core', '>= 3.1.0', '< 4.0'
s.add_dependency 'spree_backend', '>= 3.1.0', '< 4.0'
end
| Set spree dependencies to >= 3.1.0 and < 4.0 versions | Set spree dependencies to >= 3.1.0 and < 4.0 versions | Ruby | bsd-3-clause | spree-contrib/spree_slider,spree-contrib/spree_slider | ruby | ## Code Before:
Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'spree_slider'
s.version = '3.2.0.alpha'
s.summary = 'Spree Slider extension'
s.description = 'Adds a slider to the homepage'
s.required_ruby_version = '>= 1.8.7'
s.author = 'Giuseppe Privitera'
s.email = 'priviterag@gmail.com'
s.homepage = 'https://github.com/priviterag/spree_slider'
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.require_path = 'lib'
s.requirements << 'none'
s.add_dependency 'spree_core', '>= 3.2.0.alpha'
s.add_dependency 'spree_backend', '>= 3.2.0.alpha'
end
## Instruction:
Set spree dependencies to >= 3.1.0 and < 4.0 versions
## Code After:
Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'spree_slider'
s.version = '3.2.0.alpha'
s.summary = 'Spree Slider extension'
s.description = 'Adds a slider to the homepage'
s.required_ruby_version = '>= 1.8.7'
s.author = 'Giuseppe Privitera'
s.email = 'priviterag@gmail.com'
s.homepage = 'https://github.com/priviterag/spree_slider'
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.require_path = 'lib'
s.requirements << 'none'
s.add_dependency 'spree_core', '>= 3.1.0', '< 4.0'
s.add_dependency 'spree_backend', '>= 3.1.0', '< 4.0'
end
| Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'spree_slider'
s.version = '3.2.0.alpha'
s.summary = 'Spree Slider extension'
s.description = 'Adds a slider to the homepage'
s.required_ruby_version = '>= 1.8.7'
s.author = 'Giuseppe Privitera'
s.email = 'priviterag@gmail.com'
s.homepage = 'https://github.com/priviterag/spree_slider'
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.require_path = 'lib'
s.requirements << 'none'
- s.add_dependency 'spree_core', '>= 3.2.0.alpha'
? ^ ^^^^^
+ s.add_dependency 'spree_core', '>= 3.1.0', '< 4.0'
? ^ +++++++ ^
- s.add_dependency 'spree_backend', '>= 3.2.0.alpha'
? ^ ^^^^^
+ s.add_dependency 'spree_backend', '>= 3.1.0', '< 4.0'
? ^ +++++++ ^
end | 4 | 0.2 | 2 | 2 |
c8e18f132d67080cdcbd27bb1707ac30913b35b6 | destroyJenkinsSlave.sh | destroyJenkinsSlave.sh |
PROJECT_NAME=${PROJECT_NAME:-demo}
docker rm -v ${PROJECT_NAME}-workspace
|
PROJECT_NAME=${PROJECT_NAME:-demo}
if [ -n "$(docker ps -a | grep ${PROJECT_NAME}-workspace)" ]; then
docker rm -v ${PROJECT_NAME}-workspace
fi
| Add conditional check before remove container | Add conditional check before remove container
| Shell | apache-2.0 | openfrontier/jenkins-slave-docker | shell | ## Code Before:
PROJECT_NAME=${PROJECT_NAME:-demo}
docker rm -v ${PROJECT_NAME}-workspace
## Instruction:
Add conditional check before remove container
## Code After:
PROJECT_NAME=${PROJECT_NAME:-demo}
if [ -n "$(docker ps -a | grep ${PROJECT_NAME}-workspace)" ]; then
docker rm -v ${PROJECT_NAME}-workspace
fi
|
PROJECT_NAME=${PROJECT_NAME:-demo}
+ if [ -n "$(docker ps -a | grep ${PROJECT_NAME}-workspace)" ]; then
- docker rm -v ${PROJECT_NAME}-workspace
+ docker rm -v ${PROJECT_NAME}-workspace
? ++
+ fi | 4 | 1 | 3 | 1 |
566db0185abf14a5918a7a637fdab4447bfd4df6 | stdeb.cfg | stdeb.cfg | [DEFAULT]
Depends: python-xlrd, python-wxgtk2.8, python-mysqldb, python-psycopg2
XS-Python-Version: >= 2.6
| [DEFAULT]
Depends: python-xlrd, python-wxgtk2.8 | python-wxgtk3.0, python-mysqldb, python-psycopg2
XS-Python-Version: >= 2.6
| Allow either wxPython 2.8 or 3.0 for Debian package | Allow either wxPython 2.8 or 3.0 for Debian package
The current testing version of Debian only includes wxPython 3.0.
Since the name of the Debian package includes the version number this
means that the Debian package needs to allow 3.0 as well as 2.8 to
support both current and future Debian and Debian derived Linux distributions.
Thanks to @cboettig for pointing this out.
Fixes #247.
| INI | mit | goelakash/retriever,goelakash/retriever,davharris/retriever,bendmorris/retriever,henrykironde/deletedret,embaldridge/retriever,bendmorris/retriever,henrykironde/deletedret,embaldridge/retriever,embaldridge/retriever,davharris/retriever,davharris/retriever,bendmorris/retriever | ini | ## Code Before:
[DEFAULT]
Depends: python-xlrd, python-wxgtk2.8, python-mysqldb, python-psycopg2
XS-Python-Version: >= 2.6
## Instruction:
Allow either wxPython 2.8 or 3.0 for Debian package
The current testing version of Debian only includes wxPython 3.0.
Since the name of the Debian package includes the version number this
means that the Debian package needs to allow 3.0 as well as 2.8 to
support both current and future Debian and Debian derived Linux distributions.
Thanks to @cboettig for pointing this out.
Fixes #247.
## Code After:
[DEFAULT]
Depends: python-xlrd, python-wxgtk2.8 | python-wxgtk3.0, python-mysqldb, python-psycopg2
XS-Python-Version: >= 2.6
| [DEFAULT]
- Depends: python-xlrd, python-wxgtk2.8, python-mysqldb, python-psycopg2
+ Depends: python-xlrd, python-wxgtk2.8 | python-wxgtk3.0, python-mysqldb, python-psycopg2
? ++++++++++++++++++
XS-Python-Version: >= 2.6 | 2 | 0.666667 | 1 | 1 |
dc7cb390e38600359e15fdba947300f5be07cc03 | templates/_spec/support/simplecov.rb | templates/_spec/support/simplecov.rb | if ENV['COVERAGE']
require 'simplecov'
# Writes the coverage stat to a file to be used by Cane.
class SimpleCov::Formatter::QualityFormatter
def format(result)
SimpleCov::Formatter::HTMLFormatter.new.format(result)
File.open("coverage/covered_percent", "w") do |f|
f.puts result.source_files.covered_percent.to_f
end
end
end
SimpleCov.formatter = SimpleCov::Formatter::QualityFormatter
SimpleCov.start
end
| if ENV['COVERAGE']
require 'simplecov'
# Writes the coverage stat to a file to be used by Cane.
class SimpleCov::Formatter::QualityFormatter
def format(result)
SimpleCov::Formatter::HTMLFormatter.new.format(result)
File.open("coverage/covered_percent", "w") do |f|
f.puts result.source_files.covered_percent.to_f
end
end
end
SimpleCov.formatter = SimpleCov::Formatter::QualityFormatter
SimpleCov.start do
add_filter '/spec/'
add_filter '/config/'
add_filter '/vendor/'
add_group 'Models', 'app/models'
add_group 'Controllers', 'app/controllers'
add_group 'Helpers', 'app/helpers'
add_group 'Views', 'app/views'
add_group 'Mailers', 'app/mailers'
end
end
| Add filters and groups to Simplecov report | Add filters and groups to Simplecov report
| Ruby | mit | carbonfive/raygun,carbonfive/raygun | ruby | ## Code Before:
if ENV['COVERAGE']
require 'simplecov'
# Writes the coverage stat to a file to be used by Cane.
class SimpleCov::Formatter::QualityFormatter
def format(result)
SimpleCov::Formatter::HTMLFormatter.new.format(result)
File.open("coverage/covered_percent", "w") do |f|
f.puts result.source_files.covered_percent.to_f
end
end
end
SimpleCov.formatter = SimpleCov::Formatter::QualityFormatter
SimpleCov.start
end
## Instruction:
Add filters and groups to Simplecov report
## Code After:
if ENV['COVERAGE']
require 'simplecov'
# Writes the coverage stat to a file to be used by Cane.
class SimpleCov::Formatter::QualityFormatter
def format(result)
SimpleCov::Formatter::HTMLFormatter.new.format(result)
File.open("coverage/covered_percent", "w") do |f|
f.puts result.source_files.covered_percent.to_f
end
end
end
SimpleCov.formatter = SimpleCov::Formatter::QualityFormatter
SimpleCov.start do
add_filter '/spec/'
add_filter '/config/'
add_filter '/vendor/'
add_group 'Models', 'app/models'
add_group 'Controllers', 'app/controllers'
add_group 'Helpers', 'app/helpers'
add_group 'Views', 'app/views'
add_group 'Mailers', 'app/mailers'
end
end
| if ENV['COVERAGE']
require 'simplecov'
# Writes the coverage stat to a file to be used by Cane.
class SimpleCov::Formatter::QualityFormatter
def format(result)
SimpleCov::Formatter::HTMLFormatter.new.format(result)
File.open("coverage/covered_percent", "w") do |f|
f.puts result.source_files.covered_percent.to_f
end
end
end
SimpleCov.formatter = SimpleCov::Formatter::QualityFormatter
- SimpleCov.start
+ SimpleCov.start do
? +++
+ add_filter '/spec/'
+ add_filter '/config/'
+ add_filter '/vendor/'
+ add_group 'Models', 'app/models'
+ add_group 'Controllers', 'app/controllers'
+ add_group 'Helpers', 'app/helpers'
+ add_group 'Views', 'app/views'
+ add_group 'Mailers', 'app/mailers'
+ end
end | 11 | 0.6875 | 10 | 1 |
f54df6b3154a5b716297ca26ae0351006a29b984 | pizan-website/src/main/webapp/App.html | pizan-website/src/main/webapp/App.html | <!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel='shortcut icon' href='favicon.ico'>
<!--[if IE]>
<script type="text/javascript" event="FSCommand(command,args)"
for="fsipages">
fsipages_DoFSCommand(command, args);
</script>
<script type="text/javascript" event="FSCommand(command,args)"
for="fsishowcase">
fsishowcase_DoFSCommand(command, args);
</script>
<![endif]-->
<script language='javascript' src='http://www.google-analytics.com/ga.js'></script>
<script language='javascript' src='http://www.google.com/jsapi'></script>
</head>
<body>
<script language='javascript'>
var pageTracker = _gat._getTracker("");
pageTracker._trackPageview();
</script>
<script language='javascript' src='app/app.nocache.js'></script>
<noscript>
<p>This is a rich browser application which requires JavaScript.
Please activate JavaScript to view this content.
</p>
</noscript>
<iframe src="javascript:''" id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel='shortcut icon' href='favicon.ico'>
<!--[if IE]>
<script type="text/javascript" event="FSCommand(command,args)"
for="fsipages">
fsipages_DoFSCommand(command, args);
</script>
<script type="text/javascript" event="FSCommand(command,args)"
for="fsishowcase">
fsishowcase_DoFSCommand(command, args);
</script>
<![endif]-->
<script language='javascript' src='http://www.google-analytics.com/ga.js'></script>
<script language='javascript' src='http://www.google.com/jsapi'></script>
</head>
<body>
<script language='javascript'>
var pageTracker = _gat._getTracker("UA-3976164-6");
pageTracker._trackPageview();
</script>
<script language='javascript' src='app/app.nocache.js'></script>
<noscript>
<p>This is a rich browser application which requires JavaScript.
Please activate JavaScript to view this content.
</p>
</noscript>
<iframe src="javascript:''" id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe>
</body>
</html>
| Add google analytics tracking code | Add google analytics tracking code
| HTML | apache-2.0 | jhu-digital-manuscripts/rosa,jhu-digital-manuscripts/rosa,jhu-digital-manuscripts/rosa | html | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel='shortcut icon' href='favicon.ico'>
<!--[if IE]>
<script type="text/javascript" event="FSCommand(command,args)"
for="fsipages">
fsipages_DoFSCommand(command, args);
</script>
<script type="text/javascript" event="FSCommand(command,args)"
for="fsishowcase">
fsishowcase_DoFSCommand(command, args);
</script>
<![endif]-->
<script language='javascript' src='http://www.google-analytics.com/ga.js'></script>
<script language='javascript' src='http://www.google.com/jsapi'></script>
</head>
<body>
<script language='javascript'>
var pageTracker = _gat._getTracker("");
pageTracker._trackPageview();
</script>
<script language='javascript' src='app/app.nocache.js'></script>
<noscript>
<p>This is a rich browser application which requires JavaScript.
Please activate JavaScript to view this content.
</p>
</noscript>
<iframe src="javascript:''" id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe>
</body>
</html>
## Instruction:
Add google analytics tracking code
## Code After:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel='shortcut icon' href='favicon.ico'>
<!--[if IE]>
<script type="text/javascript" event="FSCommand(command,args)"
for="fsipages">
fsipages_DoFSCommand(command, args);
</script>
<script type="text/javascript" event="FSCommand(command,args)"
for="fsishowcase">
fsishowcase_DoFSCommand(command, args);
</script>
<![endif]-->
<script language='javascript' src='http://www.google-analytics.com/ga.js'></script>
<script language='javascript' src='http://www.google.com/jsapi'></script>
</head>
<body>
<script language='javascript'>
var pageTracker = _gat._getTracker("UA-3976164-6");
pageTracker._trackPageview();
</script>
<script language='javascript' src='app/app.nocache.js'></script>
<noscript>
<p>This is a rich browser application which requires JavaScript.
Please activate JavaScript to view this content.
</p>
</noscript>
<iframe src="javascript:''" id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel='shortcut icon' href='favicon.ico'>
<!--[if IE]>
<script type="text/javascript" event="FSCommand(command,args)"
for="fsipages">
fsipages_DoFSCommand(command, args);
</script>
<script type="text/javascript" event="FSCommand(command,args)"
for="fsishowcase">
fsishowcase_DoFSCommand(command, args);
</script>
<![endif]-->
<script language='javascript' src='http://www.google-analytics.com/ga.js'></script>
<script language='javascript' src='http://www.google.com/jsapi'></script>
</head>
<body>
<script language='javascript'>
- var pageTracker = _gat._getTracker("");
+ var pageTracker = _gat._getTracker("UA-3976164-6");
? ++++++++++++
pageTracker._trackPageview();
</script>
<script language='javascript' src='app/app.nocache.js'></script>
<noscript>
<p>This is a rich browser application which requires JavaScript.
Please activate JavaScript to view this content.
</p>
</noscript>
<iframe src="javascript:''" id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe>
</body>
</html> | 2 | 0.052632 | 1 | 1 |
44aacf5cc0ceee1bb80e47a28cfb813872a44336 | lib/roo_on_rails/railties/http.rb | lib/roo_on_rails/railties/http.rb | module RooOnRails
module Railties
class HTTP < Rails::Railtie
initializer 'roo_on_rails.http' do |app|
$stderr.puts 'initializer roo_on_rails.http'
require 'rack/timeout/base'
require 'rack/ssl-enforcer'
require 'roo_on_rails/rack/safe_timeouts'
::Rack::Timeout.service_timeout = ENV.fetch('RACK_SERVICE_TIMEOUT', 15).to_i
::Rack::Timeout.wait_timeout = ENV.fetch('RACK_WAIT_TIMEOUT', 30).to_i
::Rack::Timeout::Logger.level = Logger::WARN
app.config.middleware.insert_before(
::Rack::Runtime,
::Rack::Timeout
)
# This needs to be inserted low in the stack, before Rails returns the
# thread-current connection to the pool.
app.config.middleware.insert_before(
ActionDispatch::Cookies,
RooOnRails::Rack::SafeTimeouts
)
if ENV.fetch('ROO_ON_RAILS_RACK_DEFLATE', 'YES').to_s =~ /\A(YES|TRUE|ON|1)\Z/i
app.config.middleware.use ::Rack::Deflater
end
# Don't use SslEnforcer in test environment as it breaks Capybara
unless Rails.env.test?
app.config.middleware.insert_before(
ActionDispatch::Cookies,
::Rack::SslEnforcer
)
end
end
end
end
end
| module RooOnRails
module Railties
class HTTP < Rails::Railtie
initializer 'roo_on_rails.http' do |app|
$stderr.puts 'initializer roo_on_rails.http'
require 'rack/timeout/base'
require 'rack/ssl-enforcer'
require 'roo_on_rails/rack/safe_timeouts'
::Rack::Timeout.service_timeout = ENV.fetch('RACK_SERVICE_TIMEOUT', 15).to_i
::Rack::Timeout.wait_timeout = ENV.fetch('RACK_WAIT_TIMEOUT', 30).to_i
::Rack::Timeout::Logger.level = Logger::WARN
app.config.middleware.insert_before(
::Rack::Runtime,
::Rack::Timeout
)
# This needs to be inserted low in the stack, before Rails returns the
# thread-current connection to the pool.
app.config.middleware.insert_before(
Rack::Head,
RooOnRails::Rack::SafeTimeouts
)
if ENV.fetch('ROO_ON_RAILS_RACK_DEFLATE', 'YES').to_s =~ /\A(YES|TRUE|ON|1)\Z/i
app.config.middleware.use ::Rack::Deflater
end
# Don't use SslEnforcer in test environment as it breaks Capybara
unless Rails.env.test?
app.config.middleware.insert_before(
ActionDispatch::Cookies,
::Rack::SslEnforcer
)
end
end
end
end
end
| Change the middleware we inserted before | Change the middleware we inserted before
| Ruby | mit | deliveroo/roo_on_rails,deliveroo/roo_on_rails,deliveroo/roo_on_rails | ruby | ## Code Before:
module RooOnRails
module Railties
class HTTP < Rails::Railtie
initializer 'roo_on_rails.http' do |app|
$stderr.puts 'initializer roo_on_rails.http'
require 'rack/timeout/base'
require 'rack/ssl-enforcer'
require 'roo_on_rails/rack/safe_timeouts'
::Rack::Timeout.service_timeout = ENV.fetch('RACK_SERVICE_TIMEOUT', 15).to_i
::Rack::Timeout.wait_timeout = ENV.fetch('RACK_WAIT_TIMEOUT', 30).to_i
::Rack::Timeout::Logger.level = Logger::WARN
app.config.middleware.insert_before(
::Rack::Runtime,
::Rack::Timeout
)
# This needs to be inserted low in the stack, before Rails returns the
# thread-current connection to the pool.
app.config.middleware.insert_before(
ActionDispatch::Cookies,
RooOnRails::Rack::SafeTimeouts
)
if ENV.fetch('ROO_ON_RAILS_RACK_DEFLATE', 'YES').to_s =~ /\A(YES|TRUE|ON|1)\Z/i
app.config.middleware.use ::Rack::Deflater
end
# Don't use SslEnforcer in test environment as it breaks Capybara
unless Rails.env.test?
app.config.middleware.insert_before(
ActionDispatch::Cookies,
::Rack::SslEnforcer
)
end
end
end
end
end
## Instruction:
Change the middleware we inserted before
## Code After:
module RooOnRails
module Railties
class HTTP < Rails::Railtie
initializer 'roo_on_rails.http' do |app|
$stderr.puts 'initializer roo_on_rails.http'
require 'rack/timeout/base'
require 'rack/ssl-enforcer'
require 'roo_on_rails/rack/safe_timeouts'
::Rack::Timeout.service_timeout = ENV.fetch('RACK_SERVICE_TIMEOUT', 15).to_i
::Rack::Timeout.wait_timeout = ENV.fetch('RACK_WAIT_TIMEOUT', 30).to_i
::Rack::Timeout::Logger.level = Logger::WARN
app.config.middleware.insert_before(
::Rack::Runtime,
::Rack::Timeout
)
# This needs to be inserted low in the stack, before Rails returns the
# thread-current connection to the pool.
app.config.middleware.insert_before(
Rack::Head,
RooOnRails::Rack::SafeTimeouts
)
if ENV.fetch('ROO_ON_RAILS_RACK_DEFLATE', 'YES').to_s =~ /\A(YES|TRUE|ON|1)\Z/i
app.config.middleware.use ::Rack::Deflater
end
# Don't use SslEnforcer in test environment as it breaks Capybara
unless Rails.env.test?
app.config.middleware.insert_before(
ActionDispatch::Cookies,
::Rack::SslEnforcer
)
end
end
end
end
end
| module RooOnRails
module Railties
class HTTP < Rails::Railtie
initializer 'roo_on_rails.http' do |app|
$stderr.puts 'initializer roo_on_rails.http'
require 'rack/timeout/base'
require 'rack/ssl-enforcer'
require 'roo_on_rails/rack/safe_timeouts'
::Rack::Timeout.service_timeout = ENV.fetch('RACK_SERVICE_TIMEOUT', 15).to_i
::Rack::Timeout.wait_timeout = ENV.fetch('RACK_WAIT_TIMEOUT', 30).to_i
::Rack::Timeout::Logger.level = Logger::WARN
app.config.middleware.insert_before(
::Rack::Runtime,
::Rack::Timeout
)
# This needs to be inserted low in the stack, before Rails returns the
# thread-current connection to the pool.
app.config.middleware.insert_before(
- ActionDispatch::Cookies,
+ Rack::Head,
RooOnRails::Rack::SafeTimeouts
)
if ENV.fetch('ROO_ON_RAILS_RACK_DEFLATE', 'YES').to_s =~ /\A(YES|TRUE|ON|1)\Z/i
app.config.middleware.use ::Rack::Deflater
end
# Don't use SslEnforcer in test environment as it breaks Capybara
unless Rails.env.test?
app.config.middleware.insert_before(
ActionDispatch::Cookies,
::Rack::SslEnforcer
)
end
end
end
end
end | 2 | 0.04878 | 1 | 1 |
43f89d6a8a19f87d57ee74b30b7f0e664a958a2f | tests/integration/components/canvas-block-filter/component-test.js | tests/integration/components/canvas-block-filter/component-test.js | import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('canvas-block-filter',
'Integration | Component | canvas block filter', {
integration: true
});
test('it renders', function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
this.render(hbs`{{canvas-block-filter}}`);
assert.ok(this.$('input[type=text]').get(0));
});
| import { moduleForComponent, test } from 'ember-qunit';
import Ember from 'ember';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('canvas-block-filter',
'Integration | Component | canvas block filter', {
integration: true
});
test('it binds a filter term', function(assert) {
this.set('filterTerm', 'Foo');
this.render(hbs`{{canvas-block-filter filterTerm=filterTerm}}`);
assert.equal(this.$('input').val(), 'Foo');
this.$('input').val('Bar').trigger('input');
assert.equal(this.get('filterTerm'), 'Bar');
});
test('it clears the filter when closing', function(assert) {
this.set('filterTerm', 'Foo');
this.set('onCloseFilter', Ember.K);
this.render(hbs`{{canvas-block-filter
onCloseFilter=onCloseFilter
filterTerm=filterTerm}}`);
this.$('button').click();
assert.equal(this.get('filterTerm'), '');
});
test('it calls a close callback', function(assert) {
this.set('onCloseFilter', _ => assert.ok(true));
this.render(hbs`{{canvas-block-filter onCloseFilter=onCloseFilter}}`);
this.$('button').click();
});
| Add meaningful tests to canvas-block-filter | Add meaningful tests to canvas-block-filter
| JavaScript | apache-2.0 | usecanvas/web-v2,usecanvas/web-v2,usecanvas/web-v2 | javascript | ## Code Before:
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('canvas-block-filter',
'Integration | Component | canvas block filter', {
integration: true
});
test('it renders', function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
this.render(hbs`{{canvas-block-filter}}`);
assert.ok(this.$('input[type=text]').get(0));
});
## Instruction:
Add meaningful tests to canvas-block-filter
## Code After:
import { moduleForComponent, test } from 'ember-qunit';
import Ember from 'ember';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('canvas-block-filter',
'Integration | Component | canvas block filter', {
integration: true
});
test('it binds a filter term', function(assert) {
this.set('filterTerm', 'Foo');
this.render(hbs`{{canvas-block-filter filterTerm=filterTerm}}`);
assert.equal(this.$('input').val(), 'Foo');
this.$('input').val('Bar').trigger('input');
assert.equal(this.get('filterTerm'), 'Bar');
});
test('it clears the filter when closing', function(assert) {
this.set('filterTerm', 'Foo');
this.set('onCloseFilter', Ember.K);
this.render(hbs`{{canvas-block-filter
onCloseFilter=onCloseFilter
filterTerm=filterTerm}}`);
this.$('button').click();
assert.equal(this.get('filterTerm'), '');
});
test('it calls a close callback', function(assert) {
this.set('onCloseFilter', _ => assert.ok(true));
this.render(hbs`{{canvas-block-filter onCloseFilter=onCloseFilter}}`);
this.$('button').click();
});
| import { moduleForComponent, test } from 'ember-qunit';
+ import Ember from 'ember';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('canvas-block-filter',
'Integration | Component | canvas block filter', {
integration: true
});
- test('it renders', function(assert) {
? ^^ ^
+ test('it binds a filter term', function(assert) {
? ^^ ++++++++ ^^^^^
+ this.set('filterTerm', 'Foo');
- // Set any properties with this.set('myProperty', 'value');
- // Handle any actions with this.on('myAction', function(val) { ... });
- this.render(hbs`{{canvas-block-filter}}`);
+ this.render(hbs`{{canvas-block-filter filterTerm=filterTerm}}`);
? ++++++++++++++++++++++
- assert.ok(this.$('input[type=text]').get(0));
+ assert.equal(this.$('input').val(), 'Foo');
+ this.$('input').val('Bar').trigger('input');
+ assert.equal(this.get('filterTerm'), 'Bar');
});
+
+ test('it clears the filter when closing', function(assert) {
+ this.set('filterTerm', 'Foo');
+ this.set('onCloseFilter', Ember.K);
+ this.render(hbs`{{canvas-block-filter
+ onCloseFilter=onCloseFilter
+ filterTerm=filterTerm}}`);
+ this.$('button').click();
+ assert.equal(this.get('filterTerm'), '');
+ });
+
+ test('it calls a close callback', function(assert) {
+ this.set('onCloseFilter', _ => assert.ok(true));
+ this.render(hbs`{{canvas-block-filter onCloseFilter=onCloseFilter}}`);
+ this.$('button').click();
+ }); | 28 | 2 | 23 | 5 |
90ea09728536e516902dbac2643adf4f8a3f3ff8 | octopelican.php | octopelican.php | <?php
function rewriteHeader($headline, $oldTag, $newTag) {
if (strpos($headline, $oldTag) === 0) {
$data = substr($headline, strlen($oldTag));
$data = str_replace('"', '', $data);
return $newTag . $data . "\n";
}
else {
return NULL;
}
}
if (count($argv) < 2) {
echo "Too few params. Need a file name to apply changes.";
exit -1;
}
$filename = realpath($argv[1]);
echo "Parsing " . $filename . " ...\n";
$content = file_get_contents($filename);
$parts = explode('---', $content);
$header = explode("\n", $parts[1]);
$body = $parts[2];
$newHeader = "";
foreach ($header as $headline) {
$newHeader .= rewriteHeader($headline, 'title:', 'Title:');
$newHeader .= rewriteHeader($headline, 'date:', 'Date:');
$newHeader .= rewriteHeader($headline, 'categories:', 'Tags:');
}
$newHeader .= "Category: Blog\n";
$newHeader .= "Author: Antonio Jesus Sanchez Padial\n";
echo $newHeader . $body;
| <?php
function rewriteHeader($headline, $oldTag, $newTag) {
if (strpos($headline, $oldTag) === 0) {
$data = substr($headline, strlen($oldTag));
$data = str_replace('"', '', $data);
return $newTag . $data . "\n";
}
else {
return NULL;
}
}
if (count($argv) < 2) {
echo "Too few params. Need a file name to apply changes.";
exit -1;
}
$filename = realpath($argv[1]);
$content = file_get_contents($filename);
$parts = explode('---', $content);
$tokens = count($parts);
$header = explode("\n", $parts[$tokens - 2]);
$body = $parts[$tokens - 1];
$newHeader = "";
foreach ($header as $headline) {
$newHeader .= rewriteHeader($headline, 'title:', 'Title:');
$newHeader .= rewriteHeader($headline, 'date:', 'Date:');
$newHeader .= rewriteHeader($headline, 'categories:', 'Tags:');
}
$newHeader .= "Category: Blog\n";
$newHeader .= "Author: Antonio Jesus Sanchez Padial\n";
echo $newHeader . $body;
| Simplify standard input to allow redirection. | Simplify standard input to allow redirection.
| PHP | mit | ajspadial/octopelican | php | ## Code Before:
<?php
function rewriteHeader($headline, $oldTag, $newTag) {
if (strpos($headline, $oldTag) === 0) {
$data = substr($headline, strlen($oldTag));
$data = str_replace('"', '', $data);
return $newTag . $data . "\n";
}
else {
return NULL;
}
}
if (count($argv) < 2) {
echo "Too few params. Need a file name to apply changes.";
exit -1;
}
$filename = realpath($argv[1]);
echo "Parsing " . $filename . " ...\n";
$content = file_get_contents($filename);
$parts = explode('---', $content);
$header = explode("\n", $parts[1]);
$body = $parts[2];
$newHeader = "";
foreach ($header as $headline) {
$newHeader .= rewriteHeader($headline, 'title:', 'Title:');
$newHeader .= rewriteHeader($headline, 'date:', 'Date:');
$newHeader .= rewriteHeader($headline, 'categories:', 'Tags:');
}
$newHeader .= "Category: Blog\n";
$newHeader .= "Author: Antonio Jesus Sanchez Padial\n";
echo $newHeader . $body;
## Instruction:
Simplify standard input to allow redirection.
## Code After:
<?php
function rewriteHeader($headline, $oldTag, $newTag) {
if (strpos($headline, $oldTag) === 0) {
$data = substr($headline, strlen($oldTag));
$data = str_replace('"', '', $data);
return $newTag . $data . "\n";
}
else {
return NULL;
}
}
if (count($argv) < 2) {
echo "Too few params. Need a file name to apply changes.";
exit -1;
}
$filename = realpath($argv[1]);
$content = file_get_contents($filename);
$parts = explode('---', $content);
$tokens = count($parts);
$header = explode("\n", $parts[$tokens - 2]);
$body = $parts[$tokens - 1];
$newHeader = "";
foreach ($header as $headline) {
$newHeader .= rewriteHeader($headline, 'title:', 'Title:');
$newHeader .= rewriteHeader($headline, 'date:', 'Date:');
$newHeader .= rewriteHeader($headline, 'categories:', 'Tags:');
}
$newHeader .= "Category: Blog\n";
$newHeader .= "Author: Antonio Jesus Sanchez Padial\n";
echo $newHeader . $body;
| <?php
function rewriteHeader($headline, $oldTag, $newTag) {
if (strpos($headline, $oldTag) === 0) {
$data = substr($headline, strlen($oldTag));
$data = str_replace('"', '', $data);
return $newTag . $data . "\n";
}
else {
return NULL;
}
}
if (count($argv) < 2) {
echo "Too few params. Need a file name to apply changes.";
exit -1;
}
$filename = realpath($argv[1]);
- echo "Parsing " . $filename . " ...\n";
-
$content = file_get_contents($filename);
$parts = explode('---', $content);
+ $tokens = count($parts);
+
- $header = explode("\n", $parts[1]);
? ^
+ $header = explode("\n", $parts[$tokens - 2]);
? ^^^^^^^^^^^
- $body = $parts[2];
+ $body = $parts[$tokens - 1];
+
$newHeader = "";
foreach ($header as $headline) {
$newHeader .= rewriteHeader($headline, 'title:', 'Title:');
$newHeader .= rewriteHeader($headline, 'date:', 'Date:');
$newHeader .= rewriteHeader($headline, 'categories:', 'Tags:');
}
$newHeader .= "Category: Blog\n";
$newHeader .= "Author: Antonio Jesus Sanchez Padial\n";
echo $newHeader . $body;
| 9 | 0.225 | 5 | 4 |
cb08d25f49b8b4c5177c8afdd9a69330992ee854 | tests/replay/test_replay.py | tests/replay/test_replay.py |
import pytest
from cookiecutter import replay, main, exceptions
def test_get_replay_file_name():
"""Make sure that replay.get_file_name generates a valid json file path."""
assert replay.get_file_name('foo', 'bar') == 'foo/bar.json'
@pytest.fixture(params=[
{'no_input': True},
{'extra_context': {}},
{'no_input': True, 'extra_context': {}},
])
def invalid_kwargs(request):
return request.param
def test_raise_on_invalid_mode(invalid_kwargs):
with pytest.raises(exceptions.InvalidModeException):
main.cookiecutter('foo', replay=True, **invalid_kwargs)
|
import pytest
from cookiecutter import replay, main, exceptions
def test_get_replay_file_name():
"""Make sure that replay.get_file_name generates a valid json file path."""
assert replay.get_file_name('foo', 'bar') == 'foo/bar.json'
@pytest.fixture(params=[
{'no_input': True},
{'extra_context': {}},
{'no_input': True, 'extra_context': {}},
])
def invalid_kwargs(request):
return request.param
def test_raise_on_invalid_mode(invalid_kwargs):
with pytest.raises(exceptions.InvalidModeException):
main.cookiecutter('foo', replay=True, **invalid_kwargs)
def test_main_does_not_invoke_dump_but_load(mocker):
mock_prompt = mocker.patch('cookiecutter.main.prompt_for_config')
mock_gen_context = mocker.patch('cookiecutter.main.generate_context')
mock_gen_files = mocker.patch('cookiecutter.main.generate_files')
mock_replay_dump = mocker.patch('cookiecutter.main.dump')
mock_replay_load = mocker.patch('cookiecutter.main.load')
main.cookiecutter('foobar', replay=True)
assert not mock_prompt.called
assert not mock_gen_context.called
assert not mock_replay_dump.called
assert mock_replay_load.called
assert mock_gen_files.called
def test_main_does_not_invoke_load_but_dump(mocker):
mock_prompt = mocker.patch('cookiecutter.main.prompt_for_config')
mock_gen_context = mocker.patch('cookiecutter.main.generate_context')
mock_gen_files = mocker.patch('cookiecutter.main.generate_files')
mock_replay_dump = mocker.patch('cookiecutter.main.dump')
mock_replay_load = mocker.patch('cookiecutter.main.load')
main.cookiecutter('foobar', replay=False)
assert mock_prompt.called
assert mock_gen_context.called
assert mock_replay_dump.called
assert not mock_replay_load.called
assert mock_gen_files.called
| Add tests for a correct behaviour in cookiecutter.main for replay | Add tests for a correct behaviour in cookiecutter.main for replay
| Python | bsd-3-clause | christabor/cookiecutter,luzfcb/cookiecutter,hackebrot/cookiecutter,cguardia/cookiecutter,pjbull/cookiecutter,dajose/cookiecutter,michaeljoseph/cookiecutter,moi65/cookiecutter,terryjbates/cookiecutter,takeflight/cookiecutter,terryjbates/cookiecutter,luzfcb/cookiecutter,agconti/cookiecutter,cguardia/cookiecutter,christabor/cookiecutter,audreyr/cookiecutter,stevepiercy/cookiecutter,willingc/cookiecutter,venumech/cookiecutter,stevepiercy/cookiecutter,takeflight/cookiecutter,pjbull/cookiecutter,benthomasson/cookiecutter,agconti/cookiecutter,benthomasson/cookiecutter,Springerle/cookiecutter,ramiroluz/cookiecutter,audreyr/cookiecutter,moi65/cookiecutter,dajose/cookiecutter,hackebrot/cookiecutter,michaeljoseph/cookiecutter,Springerle/cookiecutter,ramiroluz/cookiecutter,venumech/cookiecutter,willingc/cookiecutter | python | ## Code Before:
import pytest
from cookiecutter import replay, main, exceptions
def test_get_replay_file_name():
"""Make sure that replay.get_file_name generates a valid json file path."""
assert replay.get_file_name('foo', 'bar') == 'foo/bar.json'
@pytest.fixture(params=[
{'no_input': True},
{'extra_context': {}},
{'no_input': True, 'extra_context': {}},
])
def invalid_kwargs(request):
return request.param
def test_raise_on_invalid_mode(invalid_kwargs):
with pytest.raises(exceptions.InvalidModeException):
main.cookiecutter('foo', replay=True, **invalid_kwargs)
## Instruction:
Add tests for a correct behaviour in cookiecutter.main for replay
## Code After:
import pytest
from cookiecutter import replay, main, exceptions
def test_get_replay_file_name():
"""Make sure that replay.get_file_name generates a valid json file path."""
assert replay.get_file_name('foo', 'bar') == 'foo/bar.json'
@pytest.fixture(params=[
{'no_input': True},
{'extra_context': {}},
{'no_input': True, 'extra_context': {}},
])
def invalid_kwargs(request):
return request.param
def test_raise_on_invalid_mode(invalid_kwargs):
with pytest.raises(exceptions.InvalidModeException):
main.cookiecutter('foo', replay=True, **invalid_kwargs)
def test_main_does_not_invoke_dump_but_load(mocker):
mock_prompt = mocker.patch('cookiecutter.main.prompt_for_config')
mock_gen_context = mocker.patch('cookiecutter.main.generate_context')
mock_gen_files = mocker.patch('cookiecutter.main.generate_files')
mock_replay_dump = mocker.patch('cookiecutter.main.dump')
mock_replay_load = mocker.patch('cookiecutter.main.load')
main.cookiecutter('foobar', replay=True)
assert not mock_prompt.called
assert not mock_gen_context.called
assert not mock_replay_dump.called
assert mock_replay_load.called
assert mock_gen_files.called
def test_main_does_not_invoke_load_but_dump(mocker):
mock_prompt = mocker.patch('cookiecutter.main.prompt_for_config')
mock_gen_context = mocker.patch('cookiecutter.main.generate_context')
mock_gen_files = mocker.patch('cookiecutter.main.generate_files')
mock_replay_dump = mocker.patch('cookiecutter.main.dump')
mock_replay_load = mocker.patch('cookiecutter.main.load')
main.cookiecutter('foobar', replay=False)
assert mock_prompt.called
assert mock_gen_context.called
assert mock_replay_dump.called
assert not mock_replay_load.called
assert mock_gen_files.called
|
import pytest
from cookiecutter import replay, main, exceptions
def test_get_replay_file_name():
"""Make sure that replay.get_file_name generates a valid json file path."""
assert replay.get_file_name('foo', 'bar') == 'foo/bar.json'
@pytest.fixture(params=[
{'no_input': True},
{'extra_context': {}},
{'no_input': True, 'extra_context': {}},
])
def invalid_kwargs(request):
return request.param
def test_raise_on_invalid_mode(invalid_kwargs):
with pytest.raises(exceptions.InvalidModeException):
main.cookiecutter('foo', replay=True, **invalid_kwargs)
+
+
+ def test_main_does_not_invoke_dump_but_load(mocker):
+ mock_prompt = mocker.patch('cookiecutter.main.prompt_for_config')
+ mock_gen_context = mocker.patch('cookiecutter.main.generate_context')
+ mock_gen_files = mocker.patch('cookiecutter.main.generate_files')
+ mock_replay_dump = mocker.patch('cookiecutter.main.dump')
+ mock_replay_load = mocker.patch('cookiecutter.main.load')
+
+ main.cookiecutter('foobar', replay=True)
+
+ assert not mock_prompt.called
+ assert not mock_gen_context.called
+ assert not mock_replay_dump.called
+ assert mock_replay_load.called
+ assert mock_gen_files.called
+
+
+ def test_main_does_not_invoke_load_but_dump(mocker):
+ mock_prompt = mocker.patch('cookiecutter.main.prompt_for_config')
+ mock_gen_context = mocker.patch('cookiecutter.main.generate_context')
+ mock_gen_files = mocker.patch('cookiecutter.main.generate_files')
+ mock_replay_dump = mocker.patch('cookiecutter.main.dump')
+ mock_replay_load = mocker.patch('cookiecutter.main.load')
+
+ main.cookiecutter('foobar', replay=False)
+
+ assert mock_prompt.called
+ assert mock_gen_context.called
+ assert mock_replay_dump.called
+ assert not mock_replay_load.called
+ assert mock_gen_files.called | 32 | 1.391304 | 32 | 0 |
2a687e50a703499e0b98883800fea5b5a2532ae2 | syntex/Cargo.toml | syntex/Cargo.toml | [package]
name = "syntex"
version = "0.5.0"
authors = [ "erick.tryzelaar@gmail.com" ]
license = "MIT/Apache-2.0"
description = "A library that enables compile time syntax extension expansion"
repository = "https://github.com/erickt/rust-syntex"
[dependencies]
syntex_syntax = { version = "*", path = "../syntex_syntax" }
| [package]
name = "syntex"
version = "0.5.0"
authors = [ "erick.tryzelaar@gmail.com" ]
license = "MIT/Apache-2.0"
description = "A library that enables compile time syntax extension expansion"
repository = "https://github.com/erickt/rust-syntex"
readme = "../README.md"
[dependencies]
syntex_syntax = { version = "*", path = "../syntex_syntax" }
| Add the readme to the crate | Add the readme to the crate
| TOML | apache-2.0 | steveklabnik/syntex,alexcrichton/syntex,erickt/rust-syntex,serde-rs/syntex,geofft/syntex,bluejekyll/syntex | toml | ## Code Before:
[package]
name = "syntex"
version = "0.5.0"
authors = [ "erick.tryzelaar@gmail.com" ]
license = "MIT/Apache-2.0"
description = "A library that enables compile time syntax extension expansion"
repository = "https://github.com/erickt/rust-syntex"
[dependencies]
syntex_syntax = { version = "*", path = "../syntex_syntax" }
## Instruction:
Add the readme to the crate
## Code After:
[package]
name = "syntex"
version = "0.5.0"
authors = [ "erick.tryzelaar@gmail.com" ]
license = "MIT/Apache-2.0"
description = "A library that enables compile time syntax extension expansion"
repository = "https://github.com/erickt/rust-syntex"
readme = "../README.md"
[dependencies]
syntex_syntax = { version = "*", path = "../syntex_syntax" }
| [package]
name = "syntex"
version = "0.5.0"
authors = [ "erick.tryzelaar@gmail.com" ]
license = "MIT/Apache-2.0"
description = "A library that enables compile time syntax extension expansion"
repository = "https://github.com/erickt/rust-syntex"
+ readme = "../README.md"
[dependencies]
syntex_syntax = { version = "*", path = "../syntex_syntax" } | 1 | 0.1 | 1 | 0 |
91fdee51ac8bd249cfdd18c46c55e664e8bc8148 | src/states/websocket.js | src/states/websocket.js | // namespace
var App = App || {};
App.WebSocketState = (function () {
"use strict";
console.log("WebSocketState.create Compiling ...");
var fn = function (game) {
Phaser.State.call(this, game);
console.log("WebSocketState.constructor Running...");
};
fn.prototype = Object.create(Phaser.State.prototype);
fn.prototype.constructor = fn;
fn.prototype.init = function () {
console.log("WebSocketState.init Running...");
};
fn.prototype.preload = function () {
console.log("WebSocketState.preload Running...");
// load assets
this.game.asset_manager.loadAssets();
};
fn.prototype.create = function () {
console.log("WebSocketState.create Running...");
var game = this.game;
// Connect to WebSocket server
console.log("Connecting to WebSocket server...");
game.global.readyWS = false;
game.global.eurecaClient = new Eureca.Client();
game.global.eurecaClient.exports = exports; // Defined in hooks.js
game.global.eurecaClient.ready(function (proxy) {
console.log("WebSocket client is ready!");
game.global.eurecaServer = proxy;
game.global.readyWS = true;
});
};
return fn;
})();
| // namespace
var App = App || {};
App.WebSocketState = (function () {
"use strict";
console.log("WebSocketState Compiling ...");
var fn = function (game) {
console.log("WebSocketState.constructor Running...");
Phaser.State.call(this, game);
};
fn.prototype = Object.create(Phaser.State.prototype);
fn.prototype.constructor = fn;
fn.prototype.init = function () {
console.log("WebSocketState.init Running...");
};
fn.prototype.preload = function () {
console.log("WebSocketState.preload Running...");
// load assets
this.game.asset_manager.loadAssets();
};
fn.prototype.create = function () {
console.log("WebSocketState.create Running...");
var game = this.game;
// Connect to WebSocket server
console.log("Connecting to WebSocket server...");
game.global.readyWS = false;
game.global.eurecaClient = new Eureca.Client();
game.global.eurecaClient.exports = exports; // Defined in hooks.js
game.global.eurecaClient.ready(function (proxy) {
console.log("WebSocket client is ready!");
game.global.eurecaServer = proxy;
game.global.readyWS = true;
});
};
return fn;
})();
| Fix typo in debugging comment | Fix typo in debugging comment
| JavaScript | mit | hookbot/multi-player,hookbot/multi-player | javascript | ## Code Before:
// namespace
var App = App || {};
App.WebSocketState = (function () {
"use strict";
console.log("WebSocketState.create Compiling ...");
var fn = function (game) {
Phaser.State.call(this, game);
console.log("WebSocketState.constructor Running...");
};
fn.prototype = Object.create(Phaser.State.prototype);
fn.prototype.constructor = fn;
fn.prototype.init = function () {
console.log("WebSocketState.init Running...");
};
fn.prototype.preload = function () {
console.log("WebSocketState.preload Running...");
// load assets
this.game.asset_manager.loadAssets();
};
fn.prototype.create = function () {
console.log("WebSocketState.create Running...");
var game = this.game;
// Connect to WebSocket server
console.log("Connecting to WebSocket server...");
game.global.readyWS = false;
game.global.eurecaClient = new Eureca.Client();
game.global.eurecaClient.exports = exports; // Defined in hooks.js
game.global.eurecaClient.ready(function (proxy) {
console.log("WebSocket client is ready!");
game.global.eurecaServer = proxy;
game.global.readyWS = true;
});
};
return fn;
})();
## Instruction:
Fix typo in debugging comment
## Code After:
// namespace
var App = App || {};
App.WebSocketState = (function () {
"use strict";
console.log("WebSocketState Compiling ...");
var fn = function (game) {
console.log("WebSocketState.constructor Running...");
Phaser.State.call(this, game);
};
fn.prototype = Object.create(Phaser.State.prototype);
fn.prototype.constructor = fn;
fn.prototype.init = function () {
console.log("WebSocketState.init Running...");
};
fn.prototype.preload = function () {
console.log("WebSocketState.preload Running...");
// load assets
this.game.asset_manager.loadAssets();
};
fn.prototype.create = function () {
console.log("WebSocketState.create Running...");
var game = this.game;
// Connect to WebSocket server
console.log("Connecting to WebSocket server...");
game.global.readyWS = false;
game.global.eurecaClient = new Eureca.Client();
game.global.eurecaClient.exports = exports; // Defined in hooks.js
game.global.eurecaClient.ready(function (proxy) {
console.log("WebSocket client is ready!");
game.global.eurecaServer = proxy;
game.global.readyWS = true;
});
};
return fn;
})();
| // namespace
var App = App || {};
App.WebSocketState = (function () {
"use strict";
- console.log("WebSocketState.create Compiling ...");
? -------
+ console.log("WebSocketState Compiling ...");
var fn = function (game) {
+ console.log("WebSocketState.constructor Running...");
Phaser.State.call(this, game);
- console.log("WebSocketState.constructor Running...");
};
fn.prototype = Object.create(Phaser.State.prototype);
fn.prototype.constructor = fn;
fn.prototype.init = function () {
console.log("WebSocketState.init Running...");
};
fn.prototype.preload = function () {
console.log("WebSocketState.preload Running...");
// load assets
this.game.asset_manager.loadAssets();
};
fn.prototype.create = function () {
console.log("WebSocketState.create Running...");
var game = this.game;
// Connect to WebSocket server
console.log("Connecting to WebSocket server...");
game.global.readyWS = false;
game.global.eurecaClient = new Eureca.Client();
game.global.eurecaClient.exports = exports; // Defined in hooks.js
game.global.eurecaClient.ready(function (proxy) {
console.log("WebSocket client is ready!");
game.global.eurecaServer = proxy;
game.global.readyWS = true;
});
};
return fn;
})(); | 4 | 0.093023 | 2 | 2 |
017cf6c18fc74e34d334726440875cf042c5b198 | README.md | README.md | My own Conway's Game of Life implementation
Impl. #2: basic
- square gamepad
- fixed size (both gamepad and cells)
- simple "game" process: pre-rendered field just to check logic
- unit-tests cover not all cases
| My own Conway's Game of Life implementation
Impl. #2: basic
- square gamepad
- fixed size (both gamepad and cells)
- simple "game" process: pre-rendered field just to check logic
- unit-tests cover not all cases
# Installation
The `npm` should be installed on your PC preliminarily.
```
# in the folder you want to store the app (e.g. Documents)
git clone XXX # <--- clones the app from Github (paste repo URL instead of "XXX")
# for now the repo URL is "https://github.com/goodwin64/conway-game-of-life.git"
cd conway-game-of-life # <--- move to the app directory from the parent
npm install # <--- install all necessary dependencies (without them app won't work)
npm test # <--- run tests and watch coverage (how the app is tested) [optional]
webpack # <--- compile the app from source files
npm start # <--- run server to watch the result
# all is done, just visit [localhost](http://localhost:8080/)
```
| Update Readme to current implementation | Update Readme to current implementation
| Markdown | mit | goodwin64/conway-game-of-life,goodwin64/conway-game-of-life | markdown | ## Code Before:
My own Conway's Game of Life implementation
Impl. #2: basic
- square gamepad
- fixed size (both gamepad and cells)
- simple "game" process: pre-rendered field just to check logic
- unit-tests cover not all cases
## Instruction:
Update Readme to current implementation
## Code After:
My own Conway's Game of Life implementation
Impl. #2: basic
- square gamepad
- fixed size (both gamepad and cells)
- simple "game" process: pre-rendered field just to check logic
- unit-tests cover not all cases
# Installation
The `npm` should be installed on your PC preliminarily.
```
# in the folder you want to store the app (e.g. Documents)
git clone XXX # <--- clones the app from Github (paste repo URL instead of "XXX")
# for now the repo URL is "https://github.com/goodwin64/conway-game-of-life.git"
cd conway-game-of-life # <--- move to the app directory from the parent
npm install # <--- install all necessary dependencies (without them app won't work)
npm test # <--- run tests and watch coverage (how the app is tested) [optional]
webpack # <--- compile the app from source files
npm start # <--- run server to watch the result
# all is done, just visit [localhost](http://localhost:8080/)
```
| My own Conway's Game of Life implementation
Impl. #2: basic
- square gamepad
- fixed size (both gamepad and cells)
- simple "game" process: pre-rendered field just to check logic
- unit-tests cover not all cases
+
+ # Installation
+ The `npm` should be installed on your PC preliminarily.
+
+ ```
+ # in the folder you want to store the app (e.g. Documents)
+ git clone XXX # <--- clones the app from Github (paste repo URL instead of "XXX")
+ # for now the repo URL is "https://github.com/goodwin64/conway-game-of-life.git"
+
+ cd conway-game-of-life # <--- move to the app directory from the parent
+
+ npm install # <--- install all necessary dependencies (without them app won't work)
+
+ npm test # <--- run tests and watch coverage (how the app is tested) [optional]
+
+ webpack # <--- compile the app from source files
+
+ npm start # <--- run server to watch the result
+ # all is done, just visit [localhost](http://localhost:8080/)
+ ``` | 20 | 2.857143 | 20 | 0 |
648ae8c62c2b49505d8dd20cac9a5e674c2ed56d | silica/UC/ApplicationWindow.qml | silica/UC/ApplicationWindow.qml | import QtQuick 2.0
import Sailfish.Silica 1.0
ApplicationWindow{
property bool inPortrait : _setOrientation(deviceOrientation)
onDeviceOrientationChanged : {
_setOrientation(deviceOrientation)
}
cover : null
/*
cover: CoverBackground {
CoverPlaceholder {
text: "modRana"
}
}*/
// this property is provided for API compatibility
// as the Silica UC backend uses the Silica built-in
// element sizing
property int hiDPI : 0
function _setOrientation(dOrient) {
if (dOrient == Orientation.Portrait ||
dOrient == Orientation.PortraitInverted) {
inPortrait = true
} else {
inPortrait = false
}
console.log("device orientation changed: " + deviceOrientation)
/* BTW, other orientations are:
Orientation.Landscape
Orientation.LandscapeInverted
*/
}
// the Silica ApplicationWindow
// does not inherit the Window element,
// so we need to add some properties
// for a common API with Controls
property string title
property var visibility : 5
function pushPage(pageInstance, pageProperties, animate) {
var animateFlag
if (animate) {
animateFlag = PageStackAction.Animated
} else {
animateFlag = PageStackAction.Immediate
}
pageStack.push(pageInstance, pageProperties, animateFlag)
return pageInstance
}
} | import QtQuick 2.0
import Sailfish.Silica 1.0
ApplicationWindow{
property bool inPortrait : _setOrientation(deviceOrientation)
onDeviceOrientationChanged : {
_setOrientation(deviceOrientation)
}
cover : null
// this property is provided for API compatibility
// as the Silica UC backend uses the Silica built-in
// element sizing
property int hiDPI : 0
function _setOrientation(dOrient) {
if (dOrient == Orientation.Portrait ||
dOrient == Orientation.PortraitInverted) {
inPortrait = true
} else {
inPortrait = false
}
console.log("device orientation changed: " + deviceOrientation)
/* BTW, other orientations are:
Orientation.Landscape
Orientation.LandscapeInverted
*/
}
// the Silica ApplicationWindow
// does not inherit the Window element,
// so we need to add some properties
// for a common API with Controls
property string title
property var visibility : 5
function pushPage(pageInstance, pageProperties, animate) {
var animateFlag
if (animate) {
animateFlag = PageStackAction.Animated
} else {
animateFlag = PageStackAction.Immediate
}
pageStack.push(pageInstance, pageProperties, animateFlag)
return pageInstance
}
}
| Remove a leftover modRana reference | Remove a leftover modRana reference
Left there since before the Universal Components split out of modRana. :)
| QML | bsd-3-clause | M4rtinK/universal-components,M4rtinK/universal-components | qml | ## Code Before:
import QtQuick 2.0
import Sailfish.Silica 1.0
ApplicationWindow{
property bool inPortrait : _setOrientation(deviceOrientation)
onDeviceOrientationChanged : {
_setOrientation(deviceOrientation)
}
cover : null
/*
cover: CoverBackground {
CoverPlaceholder {
text: "modRana"
}
}*/
// this property is provided for API compatibility
// as the Silica UC backend uses the Silica built-in
// element sizing
property int hiDPI : 0
function _setOrientation(dOrient) {
if (dOrient == Orientation.Portrait ||
dOrient == Orientation.PortraitInverted) {
inPortrait = true
} else {
inPortrait = false
}
console.log("device orientation changed: " + deviceOrientation)
/* BTW, other orientations are:
Orientation.Landscape
Orientation.LandscapeInverted
*/
}
// the Silica ApplicationWindow
// does not inherit the Window element,
// so we need to add some properties
// for a common API with Controls
property string title
property var visibility : 5
function pushPage(pageInstance, pageProperties, animate) {
var animateFlag
if (animate) {
animateFlag = PageStackAction.Animated
} else {
animateFlag = PageStackAction.Immediate
}
pageStack.push(pageInstance, pageProperties, animateFlag)
return pageInstance
}
}
## Instruction:
Remove a leftover modRana reference
Left there since before the Universal Components split out of modRana. :)
## Code After:
import QtQuick 2.0
import Sailfish.Silica 1.0
ApplicationWindow{
property bool inPortrait : _setOrientation(deviceOrientation)
onDeviceOrientationChanged : {
_setOrientation(deviceOrientation)
}
cover : null
// this property is provided for API compatibility
// as the Silica UC backend uses the Silica built-in
// element sizing
property int hiDPI : 0
function _setOrientation(dOrient) {
if (dOrient == Orientation.Portrait ||
dOrient == Orientation.PortraitInverted) {
inPortrait = true
} else {
inPortrait = false
}
console.log("device orientation changed: " + deviceOrientation)
/* BTW, other orientations are:
Orientation.Landscape
Orientation.LandscapeInverted
*/
}
// the Silica ApplicationWindow
// does not inherit the Window element,
// so we need to add some properties
// for a common API with Controls
property string title
property var visibility : 5
function pushPage(pageInstance, pageProperties, animate) {
var animateFlag
if (animate) {
animateFlag = PageStackAction.Animated
} else {
animateFlag = PageStackAction.Immediate
}
pageStack.push(pageInstance, pageProperties, animateFlag)
return pageInstance
}
}
| import QtQuick 2.0
import Sailfish.Silica 1.0
ApplicationWindow{
property bool inPortrait : _setOrientation(deviceOrientation)
onDeviceOrientationChanged : {
_setOrientation(deviceOrientation)
}
cover : null
-
- /*
- cover: CoverBackground {
- CoverPlaceholder {
- text: "modRana"
- }
- }*/
// this property is provided for API compatibility
// as the Silica UC backend uses the Silica built-in
// element sizing
property int hiDPI : 0
function _setOrientation(dOrient) {
if (dOrient == Orientation.Portrait ||
dOrient == Orientation.PortraitInverted) {
inPortrait = true
} else {
inPortrait = false
}
console.log("device orientation changed: " + deviceOrientation)
/* BTW, other orientations are:
Orientation.Landscape
Orientation.LandscapeInverted
*/
}
// the Silica ApplicationWindow
// does not inherit the Window element,
// so we need to add some properties
// for a common API with Controls
property string title
property var visibility : 5
function pushPage(pageInstance, pageProperties, animate) {
var animateFlag
if (animate) {
animateFlag = PageStackAction.Animated
} else {
animateFlag = PageStackAction.Immediate
}
pageStack.push(pageInstance, pageProperties, animateFlag)
return pageInstance
}
} | 7 | 0.122807 | 0 | 7 |
3474e109b73e0373a2663b5ae06db9aab61e1c02 | lib/gitlab/ci/config/entry/simplifiable.rb | lib/gitlab/ci/config/entry/simplifiable.rb | module Gitlab
module Ci
class Config
module Entry
class Simplifiable < SimpleDelegator
EntryStrategy = Struct.new(:name, :condition)
def initialize(config, **metadata)
unless self.class.const_defined?(:UnknownStrategy)
raise ArgumentError, 'UndefinedStrategy not available!'
end
strategy = self.class.strategies.find do |variant|
variant.condition.call(config)
end
entry = self.class.entry_class(strategy)
super(entry.new(config, metadata))
end
def self.strategy(name, **opts)
EntryStrategy.new(name, opts.fetch(:if)).tap do |strategy|
(@strategies ||= []).append(strategy)
end
end
def self.strategies
@strategies.to_a
end
def self.entry_class(strategy)
if strategy.present?
self.const_get(strategy.name)
else
self::UnknownStrategy
end
end
end
end
end
end
end
| module Gitlab
module Ci
class Config
module Entry
class Simplifiable < SimpleDelegator
EntryStrategy = Struct.new(:name, :condition)
def initialize(config, **metadata)
unless self.class.const_defined?(:UnknownStrategy)
raise ArgumentError, 'UndefinedStrategy not available!'
end
strategy = self.class.strategies.find do |variant|
variant.condition.call(config)
end
entry = self.class.entry_class(strategy)
super(entry.new(config, metadata))
end
def self.strategy(name, **opts)
EntryStrategy.new(name, opts.fetch(:if)).tap do |strategy|
strategies.append(strategy)
end
end
def self.strategies
@strategies ||= []
end
def self.entry_class(strategy)
if strategy.present?
self.const_get(strategy.name)
else
self::UnknownStrategy
end
end
end
end
end
end
end
| Simplify code for appending strategies in CI/CD config | Simplify code for appending strategies in CI/CD config
| Ruby | mit | mmkassem/gitlabhq,jirutka/gitlabhq,jirutka/gitlabhq,stoplightio/gitlabhq,iiet/iiet-git,stoplightio/gitlabhq,iiet/iiet-git,iiet/iiet-git,axilleas/gitlabhq,jirutka/gitlabhq,mmkassem/gitlabhq,axilleas/gitlabhq,dreampet/gitlab,dreampet/gitlab,dreampet/gitlab,stoplightio/gitlabhq,iiet/iiet-git,stoplightio/gitlabhq,jirutka/gitlabhq,axilleas/gitlabhq,mmkassem/gitlabhq,axilleas/gitlabhq,mmkassem/gitlabhq,dreampet/gitlab | ruby | ## Code Before:
module Gitlab
module Ci
class Config
module Entry
class Simplifiable < SimpleDelegator
EntryStrategy = Struct.new(:name, :condition)
def initialize(config, **metadata)
unless self.class.const_defined?(:UnknownStrategy)
raise ArgumentError, 'UndefinedStrategy not available!'
end
strategy = self.class.strategies.find do |variant|
variant.condition.call(config)
end
entry = self.class.entry_class(strategy)
super(entry.new(config, metadata))
end
def self.strategy(name, **opts)
EntryStrategy.new(name, opts.fetch(:if)).tap do |strategy|
(@strategies ||= []).append(strategy)
end
end
def self.strategies
@strategies.to_a
end
def self.entry_class(strategy)
if strategy.present?
self.const_get(strategy.name)
else
self::UnknownStrategy
end
end
end
end
end
end
end
## Instruction:
Simplify code for appending strategies in CI/CD config
## Code After:
module Gitlab
module Ci
class Config
module Entry
class Simplifiable < SimpleDelegator
EntryStrategy = Struct.new(:name, :condition)
def initialize(config, **metadata)
unless self.class.const_defined?(:UnknownStrategy)
raise ArgumentError, 'UndefinedStrategy not available!'
end
strategy = self.class.strategies.find do |variant|
variant.condition.call(config)
end
entry = self.class.entry_class(strategy)
super(entry.new(config, metadata))
end
def self.strategy(name, **opts)
EntryStrategy.new(name, opts.fetch(:if)).tap do |strategy|
strategies.append(strategy)
end
end
def self.strategies
@strategies ||= []
end
def self.entry_class(strategy)
if strategy.present?
self.const_get(strategy.name)
else
self::UnknownStrategy
end
end
end
end
end
end
end
| module Gitlab
module Ci
class Config
module Entry
class Simplifiable < SimpleDelegator
EntryStrategy = Struct.new(:name, :condition)
def initialize(config, **metadata)
unless self.class.const_defined?(:UnknownStrategy)
raise ArgumentError, 'UndefinedStrategy not available!'
end
strategy = self.class.strategies.find do |variant|
variant.condition.call(config)
end
entry = self.class.entry_class(strategy)
super(entry.new(config, metadata))
end
def self.strategy(name, **opts)
EntryStrategy.new(name, opts.fetch(:if)).tap do |strategy|
- (@strategies ||= []).append(strategy)
? -- --------
+ strategies.append(strategy)
end
end
def self.strategies
- @strategies.to_a
? ^^^^^
+ @strategies ||= []
? ^^^^^^^
end
def self.entry_class(strategy)
if strategy.present?
self.const_get(strategy.name)
else
self::UnknownStrategy
end
end
end
end
end
end
end | 4 | 0.093023 | 2 | 2 |
05899bd6aebf6989dbd0f41d91e53d4e15bbe660 | app/importers/data_transformers/json_transformer.rb | app/importers/data_transformers/json_transformer.rb | class JsonTransformer
def transform(file)
require 'json'
parsed = JSON.parse(file, symbolize_names: true)
parsed.each do |row|
transform_row row
end
end
def transform_row(row)
row[:local_id] = row[:local_id].to_s
# Date rows to datetime
if row[:event_date].present?
row[:event_date] = parse_date(row[:event_date])
elsif row[:date_taken].present?
row[:date_taken] = parse_date(row[:date_taken])
end
# Boolean rows to boolean
if row[:asbence].present?
row[:asbence] = parse_boolean(row[:asbence])
end
if row[:tardy].present?
row[:tardy] = parse_boolean(row[:tardy])
end
if row[:has_exact_time].present?
row[:has_exact_time] = parse_boolean(row[:has_exact_time])
end
end
def parse_date(event_date)
require 'date'
DateTime.strptime(event_date.to_s,'%s')
end
def parse_boolean(value)
case value
when "1"
true
when "0"
false
else
nil
end
end
end
| class JsonTransformer
def transform(file)
require 'json'
parsed = JSON.parse(file, symbolize_names: true)
parsed.each do |row|
transform_row row
end
end
def date_rows
[ :event_date, :date_taken, :assessment_date ]
end
def boolean_rows
[ :asbence, :tardy, :has_exact_time ]
end
def transform_row(row)
row[:local_id] = row[:local_id].to_s
# Date rows to datetime
date_rows.each do |dr|
if row[dr].present?
row[dr] = parse_date(row[dr])
end
end
boolean_rows.each do |br|
if row[br].present?
row[br] = parse_boolean(row[br])
end
end
return row
end
def parse_date(event_date)
require 'date'
DateTime.strptime(event_date.to_s,'%s')
end
def parse_boolean(value)
case value
when "1"
true
when "0"
false
else
nil
end
end
end
| Add assessment_dateto json date fields for parsing | Add assessment_dateto json date fields for parsing
| Ruby | mit | hunterowens/somerville-teacher-tool,studentinsights/studentinsights,jamestyack/somerville-teacher-tool,codeforamerica/somerville-teacher-tool,jamestyack/somerville-teacher-tool,hunterowens/somerville-teacher-tool,jhilde/studentinsights,jhilde/studentinsights,jhilde/studentinsights,codeforamerica/somerville-teacher-tool,studentinsights/studentinsights,erose/studentinsights,hunterowens/somerville-teacher-tool,studentinsights/studentinsights,studentinsights/studentinsights,jhilde/studentinsights,codeforamerica/somerville-teacher-tool,erose/studentinsights,erose/studentinsights,erose/studentinsights,codeforamerica/somerville-teacher-tool,jamestyack/somerville-teacher-tool | ruby | ## Code Before:
class JsonTransformer
def transform(file)
require 'json'
parsed = JSON.parse(file, symbolize_names: true)
parsed.each do |row|
transform_row row
end
end
def transform_row(row)
row[:local_id] = row[:local_id].to_s
# Date rows to datetime
if row[:event_date].present?
row[:event_date] = parse_date(row[:event_date])
elsif row[:date_taken].present?
row[:date_taken] = parse_date(row[:date_taken])
end
# Boolean rows to boolean
if row[:asbence].present?
row[:asbence] = parse_boolean(row[:asbence])
end
if row[:tardy].present?
row[:tardy] = parse_boolean(row[:tardy])
end
if row[:has_exact_time].present?
row[:has_exact_time] = parse_boolean(row[:has_exact_time])
end
end
def parse_date(event_date)
require 'date'
DateTime.strptime(event_date.to_s,'%s')
end
def parse_boolean(value)
case value
when "1"
true
when "0"
false
else
nil
end
end
end
## Instruction:
Add assessment_dateto json date fields for parsing
## Code After:
class JsonTransformer
def transform(file)
require 'json'
parsed = JSON.parse(file, symbolize_names: true)
parsed.each do |row|
transform_row row
end
end
def date_rows
[ :event_date, :date_taken, :assessment_date ]
end
def boolean_rows
[ :asbence, :tardy, :has_exact_time ]
end
def transform_row(row)
row[:local_id] = row[:local_id].to_s
# Date rows to datetime
date_rows.each do |dr|
if row[dr].present?
row[dr] = parse_date(row[dr])
end
end
boolean_rows.each do |br|
if row[br].present?
row[br] = parse_boolean(row[br])
end
end
return row
end
def parse_date(event_date)
require 'date'
DateTime.strptime(event_date.to_s,'%s')
end
def parse_boolean(value)
case value
when "1"
true
when "0"
false
else
nil
end
end
end
| class JsonTransformer
def transform(file)
require 'json'
parsed = JSON.parse(file, symbolize_names: true)
parsed.each do |row|
transform_row row
end
end
+ def date_rows
+ [ :event_date, :date_taken, :assessment_date ]
+ end
+
+ def boolean_rows
+ [ :asbence, :tardy, :has_exact_time ]
+ end
+
def transform_row(row)
row[:local_id] = row[:local_id].to_s
# Date rows to datetime
+ date_rows.each do |dr|
- if row[:event_date].present?
? ------- ^^^
+ if row[dr].present?
? ++ ^
+ row[dr] = parse_date(row[dr])
+ end
- row[:event_date] = parse_date(row[:event_date])
- elsif row[:date_taken].present?
- row[:date_taken] = parse_date(row[:date_taken])
end
- # Boolean rows to boolean
+ boolean_rows.each do |br|
- if row[:asbence].present?
? --- ^^^^
+ if row[br].present?
? ++ ^
- row[:asbence] = parse_boolean(row[:asbence])
? --- ^^^^ --- ^^^^
+ row[br] = parse_boolean(row[br])
? ++ ^ ^
+ end
end
+
+ return row
- if row[:tardy].present?
- row[:tardy] = parse_boolean(row[:tardy])
- end
- if row[:has_exact_time].present?
- row[:has_exact_time] = parse_boolean(row[:has_exact_time])
- end
end
def parse_date(event_date)
require 'date'
DateTime.strptime(event_date.to_s,'%s')
end
def parse_boolean(value)
case value
when "1"
true
when "0"
false
else
nil
end
end
end | 31 | 0.632653 | 18 | 13 |
a694d2de9c6673bdd6791c4132a19ab8989a0f99 | plugins/available/javascript.plugins.bash | plugins/available/javascript.plugins.bash |
function rails_jquery {
curl -o public/javascripts/rails.js http://github.com/rails/jquery-ujs/raw/master/src/rails.js
}
function jquery_install {
curl -o public/javascripts/jquery.js http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
}
function jquery_ui_install {
curl -o public/javascripts/jquery_ui.js http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js
} |
[[ -z "$JQUERY_VERSION_NUMBER" ]] && JQUERY_VERSION_NUMBER="1.6.1"
[[ -z "$JQUERY_UI_VERSION_NUMBER" ]] && JQUERY_UI_VERSION_NUMBER="1.8.13"
function rails_jquery {
curl -o public/javascripts/rails.js http://github.com/rails/jquery-ujs/raw/master/src/rails.js
}
function jquery_install {
if [ -z "$1" ]
then
version=$JQUERY_VERSION_NUMBER
else
version="$1"
fi
curl -o public/javascripts/jquery.js "http://ajax.googleapis.com/ajax/libs/jquery/$version/jquery.min.js"
}
function jquery_ui_install {
if [ -z "$1" ]
then
version=$JQUERY_UI_VERSION_NUMBER
else
version="$1"
fi
curl -o public/javascripts/jquery_ui.js "http://ajax.googleapis.com/ajax/libs/jqueryui/$version/jquery-ui.min.js"
}
| Allow specifying jQuery/jQuery UI version number and update defaults | Allow specifying jQuery/jQuery UI version number and update defaults
| Shell | mit | prajnak/bash_it | shell | ## Code Before:
function rails_jquery {
curl -o public/javascripts/rails.js http://github.com/rails/jquery-ujs/raw/master/src/rails.js
}
function jquery_install {
curl -o public/javascripts/jquery.js http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
}
function jquery_ui_install {
curl -o public/javascripts/jquery_ui.js http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js
}
## Instruction:
Allow specifying jQuery/jQuery UI version number and update defaults
## Code After:
[[ -z "$JQUERY_VERSION_NUMBER" ]] && JQUERY_VERSION_NUMBER="1.6.1"
[[ -z "$JQUERY_UI_VERSION_NUMBER" ]] && JQUERY_UI_VERSION_NUMBER="1.8.13"
function rails_jquery {
curl -o public/javascripts/rails.js http://github.com/rails/jquery-ujs/raw/master/src/rails.js
}
function jquery_install {
if [ -z "$1" ]
then
version=$JQUERY_VERSION_NUMBER
else
version="$1"
fi
curl -o public/javascripts/jquery.js "http://ajax.googleapis.com/ajax/libs/jquery/$version/jquery.min.js"
}
function jquery_ui_install {
if [ -z "$1" ]
then
version=$JQUERY_UI_VERSION_NUMBER
else
version="$1"
fi
curl -o public/javascripts/jquery_ui.js "http://ajax.googleapis.com/ajax/libs/jqueryui/$version/jquery-ui.min.js"
}
|
+ [[ -z "$JQUERY_VERSION_NUMBER" ]] && JQUERY_VERSION_NUMBER="1.6.1"
+ [[ -z "$JQUERY_UI_VERSION_NUMBER" ]] && JQUERY_UI_VERSION_NUMBER="1.8.13"
function rails_jquery {
curl -o public/javascripts/rails.js http://github.com/rails/jquery-ujs/raw/master/src/rails.js
}
function jquery_install {
+ if [ -z "$1" ]
+ then
+ version=$JQUERY_VERSION_NUMBER
+ else
+ version="$1"
+ fi
- curl -o public/javascripts/jquery.js http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
? ^^^^^
+ curl -o public/javascripts/jquery.js "http://ajax.googleapis.com/ajax/libs/jquery/$version/jquery.min.js"
? + ^^^^^^^^ +
}
- function jquery_ui_install {
? -
+ function jquery_ui_install {
+ if [ -z "$1" ]
+ then
+ version=$JQUERY_UI_VERSION_NUMBER
+ else
+ version="$1"
+ fi
+
- curl -o public/javascripts/jquery_ui.js http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js
? ^^^^^
+ curl -o public/javascripts/jquery_ui.js "http://ajax.googleapis.com/ajax/libs/jqueryui/$version/jquery-ui.min.js"
? + ^^^^^^^^ +
} | 21 | 1.615385 | 18 | 3 |
b70314893e9319c3034fba78f716231fb0b192d5 | app/views/notes/show.html.erb | app/views/notes/show.html.erb | <p id="notice"><%= notice %></p>
<p>
<strong>Title:</strong>
<%= @note.title %>
</p>
<p>
<strong>Contents:</strong>
<%= @note.contents %>
</p>
<p>
<strong>Last viewed at:</strong>
<%= @note.last_viewed_at %>
</p>
<%= link_to 'Edit', edit_note_path(@note) %> |
<%= link_to 'Back', notes_path %>
| <p id="notice"><%= notice %></p>
<p>
<strong>Title:</strong>
<%= @note.title %>
</p>
<p>
<strong>Contents:</strong>
<%= @note.contents %>
</p>
<p>
<strong>Last viewed at:</strong>
<%= @note.last_viewed_at %>
</p>
<%= link_to 'New Note', new_note_path %> |
<%= link_to 'Edit', edit_note_path(@note) %> |
<%= link_to 'Back', notes_path %>
| Add new link to shortcut | Add new link to shortcut
| HTML+ERB | mit | riseshia/reit-rails,riseshia/reit-rails,riseshia/reit-rails | html+erb | ## Code Before:
<p id="notice"><%= notice %></p>
<p>
<strong>Title:</strong>
<%= @note.title %>
</p>
<p>
<strong>Contents:</strong>
<%= @note.contents %>
</p>
<p>
<strong>Last viewed at:</strong>
<%= @note.last_viewed_at %>
</p>
<%= link_to 'Edit', edit_note_path(@note) %> |
<%= link_to 'Back', notes_path %>
## Instruction:
Add new link to shortcut
## Code After:
<p id="notice"><%= notice %></p>
<p>
<strong>Title:</strong>
<%= @note.title %>
</p>
<p>
<strong>Contents:</strong>
<%= @note.contents %>
</p>
<p>
<strong>Last viewed at:</strong>
<%= @note.last_viewed_at %>
</p>
<%= link_to 'New Note', new_note_path %> |
<%= link_to 'Edit', edit_note_path(@note) %> |
<%= link_to 'Back', notes_path %>
| <p id="notice"><%= notice %></p>
<p>
<strong>Title:</strong>
<%= @note.title %>
</p>
<p>
<strong>Contents:</strong>
<%= @note.contents %>
</p>
<p>
<strong>Last viewed at:</strong>
<%= @note.last_viewed_at %>
</p>
+ <%= link_to 'New Note', new_note_path %> |
<%= link_to 'Edit', edit_note_path(@note) %> |
<%= link_to 'Back', notes_path %> | 1 | 0.052632 | 1 | 0 |
6d2a654d9f871691fff02863a15a4dd67b9ecfe6 | app/Resources/FOSUserBundle/views/layout.html.twig | app/Resources/FOSUserBundle/views/layout.html.twig | {% extends '::base.html.twig' %}
{% block body %}
{% for key, message in app.session.getFlashBag() %}
<div class="alert alert-{{ key }}">
{{ message|trans({}, 'FOSUserBundle') }}
</div>
{% endfor %}
<div class="row">
<div class="col-xs-12">
{% block fos_user_content %}
{% endblock fos_user_content %}
</div>
</div>
{% endblock %}
| {% extends '::base.html.twig' %}
{% block body %}
{% if app.request.hasPreviousSession %}
{% for type, messages in app.session.flashbag.all() %}
{% for message in messages %}
{% if type matches '/error|danger|failure/' %}
{% set alert_class = 'danger' %}
{% elseif type matches '/success/' %}
{% set alert_class = 'success' %}
{% else %}
{% set alert_class = 'info' %}
{% endif %}
<div class="alert alert-{{ alert_class }}">
{{ message|trans({}, 'FOSUserBundle') }}
</div>
{% endfor %}
{% endfor %}
{% endif %}
<div class="row">
<div class="col-xs-12">
{% block fos_user_content %}
{% endblock fos_user_content %}
</div>
</div>
{% endblock %}
| Fix flash messages in FOSUserBundle layout override | Fix flash messages in FOSUserBundle layout override
Signed-off-by: Max Fierke <0706025b2bbcec1ed8d64822f4eccd96314938d0@maxfierke.com>
| Twig | apache-2.0 | cgjerdingen/UMNRetireesPlatform,umnretirees/membership-platform,umnretirees/membership-platform,umnretirees/membership-platform,cgjerdingen/UMNRetireesPlatform,cgjerdingen/UMNRetireesPlatform | twig | ## Code Before:
{% extends '::base.html.twig' %}
{% block body %}
{% for key, message in app.session.getFlashBag() %}
<div class="alert alert-{{ key }}">
{{ message|trans({}, 'FOSUserBundle') }}
</div>
{% endfor %}
<div class="row">
<div class="col-xs-12">
{% block fos_user_content %}
{% endblock fos_user_content %}
</div>
</div>
{% endblock %}
## Instruction:
Fix flash messages in FOSUserBundle layout override
Signed-off-by: Max Fierke <0706025b2bbcec1ed8d64822f4eccd96314938d0@maxfierke.com>
## Code After:
{% extends '::base.html.twig' %}
{% block body %}
{% if app.request.hasPreviousSession %}
{% for type, messages in app.session.flashbag.all() %}
{% for message in messages %}
{% if type matches '/error|danger|failure/' %}
{% set alert_class = 'danger' %}
{% elseif type matches '/success/' %}
{% set alert_class = 'success' %}
{% else %}
{% set alert_class = 'info' %}
{% endif %}
<div class="alert alert-{{ alert_class }}">
{{ message|trans({}, 'FOSUserBundle') }}
</div>
{% endfor %}
{% endfor %}
{% endif %}
<div class="row">
<div class="col-xs-12">
{% block fos_user_content %}
{% endblock fos_user_content %}
</div>
</div>
{% endblock %}
| {% extends '::base.html.twig' %}
{% block body %}
+ {% if app.request.hasPreviousSession %}
- {% for key, message in app.session.getFlashBag() %}
? ^ - ^^^^ ^
+ {% for type, messages in app.session.flashbag.all() %}
? ++++ ^^^ + ^ ^ ++++
+ {% for message in messages %}
+ {% if type matches '/error|danger|failure/' %}
+ {% set alert_class = 'danger' %}
+ {% elseif type matches '/success/' %}
+ {% set alert_class = 'success' %}
+ {% else %}
+ {% set alert_class = 'info' %}
+ {% endif %}
+
- <div class="alert alert-{{ key }}">
? ^ ^
+ <div class="alert alert-{{ alert_class }}">
? ++++++++++++ ^^ ^^^^^^^^
- {{ message|trans({}, 'FOSUserBundle') }}
+ {{ message|trans({}, 'FOSUserBundle') }}
? ++++++++++++
- </div>
+ </div>
+ {% endfor %}
+ {% endfor %}
- {% endfor %}
? --
+ {% endif %}
? +
<div class="row">
<div class="col-xs-12">
{% block fos_user_content %}
{% endblock fos_user_content %}
</div>
</div>
{% endblock %} | 22 | 1.375 | 17 | 5 |
fe5fdb0c77986a6a80aacbc29ba5f20c1213f144 | packages/expo-local-authentication/src/__tests__/LocalAuthentication-test.ios.ts | packages/expo-local-authentication/src/__tests__/LocalAuthentication-test.ios.ts | import ExpoLocalAuthentication from '../ExpoLocalAuthentication';
import * as LocalAuthentication from '../LocalAuthentication';
beforeEach(() => {
ExpoLocalAuthentication.authenticateAsync.mockReset();
ExpoLocalAuthentication.authenticateAsync.mockReturnValue({ success: true });
});
it(`uses promptMessage and fallbackLabel on iOS`, async () => {
const options = {
promptMessage: 'Authentication is required',
fallbackLabel: 'Use passcode',
};
await LocalAuthentication.authenticateAsync(options);
expect(ExpoLocalAuthentication.authenticateAsync).toHaveBeenLastCalledWith(options);
});
it(`throws when an invalid message is used on iOS`, async () => {
expect(
LocalAuthentication.authenticateAsync({ promptMessage: undefined as any })
).rejects.toThrow();
expect(LocalAuthentication.authenticateAsync({ promptMessage: '' })).rejects.toThrow();
expect(LocalAuthentication.authenticateAsync({ promptMessage: {} as any })).rejects.toThrow();
expect(LocalAuthentication.authenticateAsync({ promptMessage: 123 as any })).rejects.toThrow();
});
| import ExpoLocalAuthentication from '../ExpoLocalAuthentication';
import * as LocalAuthentication from '../LocalAuthentication';
beforeEach(() => {
ExpoLocalAuthentication.authenticateAsync.mockReset();
ExpoLocalAuthentication.authenticateAsync.mockImplementation(async () => ({ success: true }));
});
it(`uses promptMessage and fallbackLabel on iOS`, async () => {
const options = {
promptMessage: 'Authentication is required',
fallbackLabel: 'Use passcode',
};
await LocalAuthentication.authenticateAsync(options);
expect(ExpoLocalAuthentication.authenticateAsync).toHaveBeenLastCalledWith(options);
});
it(`throws when an invalid message is used on iOS`, async () => {
expect(
LocalAuthentication.authenticateAsync({ promptMessage: undefined as any })
).rejects.toThrow();
expect(LocalAuthentication.authenticateAsync({ promptMessage: '' })).rejects.toThrow();
expect(LocalAuthentication.authenticateAsync({ promptMessage: {} as any })).rejects.toThrow();
expect(LocalAuthentication.authenticateAsync({ promptMessage: 123 as any })).rejects.toThrow();
});
| Use a mock async function for iOS tests as well | [local-auth] Use a mock async function for iOS tests as well
The Android tests use `mockImplementation(async () => ({ success: true }));` and this does the same for iOS now.
| TypeScript | bsd-3-clause | exponent/exponent,exponentjs/exponent,exponent/exponent,exponent/exponent,exponentjs/exponent,exponentjs/exponent,exponent/exponent,exponentjs/exponent,exponentjs/exponent,exponent/exponent,exponent/exponent,exponentjs/exponent,exponentjs/exponent,exponent/exponent,exponent/exponent,exponent/exponent,exponentjs/exponent,exponentjs/exponent | typescript | ## Code Before:
import ExpoLocalAuthentication from '../ExpoLocalAuthentication';
import * as LocalAuthentication from '../LocalAuthentication';
beforeEach(() => {
ExpoLocalAuthentication.authenticateAsync.mockReset();
ExpoLocalAuthentication.authenticateAsync.mockReturnValue({ success: true });
});
it(`uses promptMessage and fallbackLabel on iOS`, async () => {
const options = {
promptMessage: 'Authentication is required',
fallbackLabel: 'Use passcode',
};
await LocalAuthentication.authenticateAsync(options);
expect(ExpoLocalAuthentication.authenticateAsync).toHaveBeenLastCalledWith(options);
});
it(`throws when an invalid message is used on iOS`, async () => {
expect(
LocalAuthentication.authenticateAsync({ promptMessage: undefined as any })
).rejects.toThrow();
expect(LocalAuthentication.authenticateAsync({ promptMessage: '' })).rejects.toThrow();
expect(LocalAuthentication.authenticateAsync({ promptMessage: {} as any })).rejects.toThrow();
expect(LocalAuthentication.authenticateAsync({ promptMessage: 123 as any })).rejects.toThrow();
});
## Instruction:
[local-auth] Use a mock async function for iOS tests as well
The Android tests use `mockImplementation(async () => ({ success: true }));` and this does the same for iOS now.
## Code After:
import ExpoLocalAuthentication from '../ExpoLocalAuthentication';
import * as LocalAuthentication from '../LocalAuthentication';
beforeEach(() => {
ExpoLocalAuthentication.authenticateAsync.mockReset();
ExpoLocalAuthentication.authenticateAsync.mockImplementation(async () => ({ success: true }));
});
it(`uses promptMessage and fallbackLabel on iOS`, async () => {
const options = {
promptMessage: 'Authentication is required',
fallbackLabel: 'Use passcode',
};
await LocalAuthentication.authenticateAsync(options);
expect(ExpoLocalAuthentication.authenticateAsync).toHaveBeenLastCalledWith(options);
});
it(`throws when an invalid message is used on iOS`, async () => {
expect(
LocalAuthentication.authenticateAsync({ promptMessage: undefined as any })
).rejects.toThrow();
expect(LocalAuthentication.authenticateAsync({ promptMessage: '' })).rejects.toThrow();
expect(LocalAuthentication.authenticateAsync({ promptMessage: {} as any })).rejects.toThrow();
expect(LocalAuthentication.authenticateAsync({ promptMessage: 123 as any })).rejects.toThrow();
});
| import ExpoLocalAuthentication from '../ExpoLocalAuthentication';
import * as LocalAuthentication from '../LocalAuthentication';
beforeEach(() => {
ExpoLocalAuthentication.authenticateAsync.mockReset();
- ExpoLocalAuthentication.authenticateAsync.mockReturnValue({ success: true });
? ^ ^^ ^ ^^^
+ ExpoLocalAuthentication.authenticateAsync.mockImplementation(async () => ({ success: true }));
? ^^^^ +++ ^^^^ ^ ^^^^^^^^^^^ +
});
it(`uses promptMessage and fallbackLabel on iOS`, async () => {
const options = {
promptMessage: 'Authentication is required',
fallbackLabel: 'Use passcode',
};
await LocalAuthentication.authenticateAsync(options);
expect(ExpoLocalAuthentication.authenticateAsync).toHaveBeenLastCalledWith(options);
});
it(`throws when an invalid message is used on iOS`, async () => {
expect(
LocalAuthentication.authenticateAsync({ promptMessage: undefined as any })
).rejects.toThrow();
expect(LocalAuthentication.authenticateAsync({ promptMessage: '' })).rejects.toThrow();
expect(LocalAuthentication.authenticateAsync({ promptMessage: {} as any })).rejects.toThrow();
expect(LocalAuthentication.authenticateAsync({ promptMessage: 123 as any })).rejects.toThrow();
}); | 2 | 0.076923 | 1 | 1 |
7c2a9288cd3fbe56cc0698296fce927fb52f3c3c | dashboard/static/js/main.js | dashboard/static/js/main.js | var wsUri = "ws://localhost:8000/ws/";
function setupWebSocket() {
var websocket = new WebSocket(wsUri);
websocket.onopen = function(evt) { onOpen(evt) };
websocket.onmessage = function(evt) { onMessage(evt) };
}
function onOpen (evt) {
console.log("Connected to websocket!");
}
function onMessage (evt) {
var spanWithPrice = document.getElementsByClassName('bitcoin-price')[0];
spanWithPrice.innerHTML = ' $' + String(JSON.parse(evt.data).last_price);
}
window.addEventListener("load", setupWebSocket, false);
| var wsUri = "ws://localhost:8000/ws/";
var websocket;
function setupWebSocket() {
websocket = new WebSocket(wsUri);
websocket.onopen = function(evt) { onOpen(evt) };
websocket.onmessage = function(evt) { onMessage(evt) };
}
function onOpen (evt) {
console.log("Connected to websocket!");
}
function onMessage (evt) {
var data = JSON.parse(evt.data);
if (data.BTC) {
$('.bitcoin-price')[0].innerHTML = ' $' + String(data.BTC);
} else {
$('.litecoin-price')[0].innerHTML = ' $' + String(data.LTC);
}
}
$(".change-coin-js").click(function (e) {
if ($(".wrapper-bitcoin").css("display") == "none") {
$(".wrapper-bitcoin").css("display", "block");
$(".wrapper-litecoin").css("display", "none");
$(".change-coin-js")[0].innerHTML = "Change to litecoin";
websocket.send(JSON.stringify({
coin: 'bitcoin'
}))
} else if ($(".wrapper-litecoin").css("display") == "none") {
$(".wrapper-litecoin").css("display", "block");
$(".wrapper-bitcoin").css("display", "none");
$(".change-coin-js")[0].innerHTML = "Change to bitcoin";
websocket.send(JSON.stringify({
coin: 'litecoin'
}))
}
});
window.addEventListener("load", setupWebSocket, false);
| Add logic to toggle the price between litecoin and bitcoin | Add logic to toggle the price between litecoin and bitcoin
| JavaScript | mit | alessandroHenrique/coinpricemonitor,alessandroHenrique/coinpricemonitor,alessandroHenrique/coinpricemonitor | javascript | ## Code Before:
var wsUri = "ws://localhost:8000/ws/";
function setupWebSocket() {
var websocket = new WebSocket(wsUri);
websocket.onopen = function(evt) { onOpen(evt) };
websocket.onmessage = function(evt) { onMessage(evt) };
}
function onOpen (evt) {
console.log("Connected to websocket!");
}
function onMessage (evt) {
var spanWithPrice = document.getElementsByClassName('bitcoin-price')[0];
spanWithPrice.innerHTML = ' $' + String(JSON.parse(evt.data).last_price);
}
window.addEventListener("load", setupWebSocket, false);
## Instruction:
Add logic to toggle the price between litecoin and bitcoin
## Code After:
var wsUri = "ws://localhost:8000/ws/";
var websocket;
function setupWebSocket() {
websocket = new WebSocket(wsUri);
websocket.onopen = function(evt) { onOpen(evt) };
websocket.onmessage = function(evt) { onMessage(evt) };
}
function onOpen (evt) {
console.log("Connected to websocket!");
}
function onMessage (evt) {
var data = JSON.parse(evt.data);
if (data.BTC) {
$('.bitcoin-price')[0].innerHTML = ' $' + String(data.BTC);
} else {
$('.litecoin-price')[0].innerHTML = ' $' + String(data.LTC);
}
}
$(".change-coin-js").click(function (e) {
if ($(".wrapper-bitcoin").css("display") == "none") {
$(".wrapper-bitcoin").css("display", "block");
$(".wrapper-litecoin").css("display", "none");
$(".change-coin-js")[0].innerHTML = "Change to litecoin";
websocket.send(JSON.stringify({
coin: 'bitcoin'
}))
} else if ($(".wrapper-litecoin").css("display") == "none") {
$(".wrapper-litecoin").css("display", "block");
$(".wrapper-bitcoin").css("display", "none");
$(".change-coin-js")[0].innerHTML = "Change to bitcoin";
websocket.send(JSON.stringify({
coin: 'litecoin'
}))
}
});
window.addEventListener("load", setupWebSocket, false);
| var wsUri = "ws://localhost:8000/ws/";
+ var websocket;
+
function setupWebSocket() {
- var websocket = new WebSocket(wsUri);
? ----
+ websocket = new WebSocket(wsUri);
websocket.onopen = function(evt) { onOpen(evt) };
websocket.onmessage = function(evt) { onMessage(evt) };
}
function onOpen (evt) {
console.log("Connected to websocket!");
}
function onMessage (evt) {
- var spanWithPrice = document.getElementsByClassName('bitcoin-price')[0];
- spanWithPrice.innerHTML = ' $' + String(JSON.parse(evt.data).last_price);
+ var data = JSON.parse(evt.data);
+
+ if (data.BTC) {
+ $('.bitcoin-price')[0].innerHTML = ' $' + String(data.BTC);
+ } else {
+ $('.litecoin-price')[0].innerHTML = ' $' + String(data.LTC);
+ }
}
+ $(".change-coin-js").click(function (e) {
+ if ($(".wrapper-bitcoin").css("display") == "none") {
+ $(".wrapper-bitcoin").css("display", "block");
+ $(".wrapper-litecoin").css("display", "none");
+
+ $(".change-coin-js")[0].innerHTML = "Change to litecoin";
+
+ websocket.send(JSON.stringify({
+ coin: 'bitcoin'
+ }))
+ } else if ($(".wrapper-litecoin").css("display") == "none") {
+ $(".wrapper-litecoin").css("display", "block");
+ $(".wrapper-bitcoin").css("display", "none");
+
+ $(".change-coin-js")[0].innerHTML = "Change to bitcoin";
+
+ websocket.send(JSON.stringify({
+ coin: 'litecoin'
+ }))
+ }
+ });
+
window.addEventListener("load", setupWebSocket, false); | 35 | 1.944444 | 32 | 3 |
0c6c6e957e3305d7ead404fc42edec2124a27566 | README.md | README.md | [Demo url](http://theghostbel.github.io/capture-asteroid/)

| [Asteroid finder](http://theghostbel.github.io/capture-asteroid/) - app to find asteroid by params in Solar system with Earth/Mars/Asteroids belt
Phisics simulations of changing the orbit of asteroid
[by relatively short impulse simulation](https://www.youtube.com/watch?v=mwSNx3kNXdc)
[by weak continuous impulse simulation (solar sails)](https://www.youtube.com/watch?v=1OB3MKc2lu8)

| Add simulation links to readme | Add simulation links to readme | Markdown | mit | er3do/capture-asteroid,theghostbel/capture-asteroid,theghostbel/capture-asteroid,er3do/capture-asteroid,abitrolly/capture-asteroid,abitrolly/capture-asteroid | markdown | ## Code Before:
[Demo url](http://theghostbel.github.io/capture-asteroid/)

## Instruction:
Add simulation links to readme
## Code After:
[Asteroid finder](http://theghostbel.github.io/capture-asteroid/) - app to find asteroid by params in Solar system with Earth/Mars/Asteroids belt
Phisics simulations of changing the orbit of asteroid
[by relatively short impulse simulation](https://www.youtube.com/watch?v=mwSNx3kNXdc)
[by weak continuous impulse simulation (solar sails)](https://www.youtube.com/watch?v=1OB3MKc2lu8)

| - [Demo url](http://theghostbel.github.io/capture-asteroid/)
+ [Asteroid finder](http://theghostbel.github.io/capture-asteroid/) - app to find asteroid by params in Solar system with Earth/Mars/Asteroids belt
+
+ Phisics simulations of changing the orbit of asteroid
+
+ [by relatively short impulse simulation](https://www.youtube.com/watch?v=mwSNx3kNXdc)
+
+ [by weak continuous impulse simulation (solar sails)](https://www.youtube.com/watch?v=1OB3MKc2lu8)
 | 8 | 2.666667 | 7 | 1 |
0ac2520ffcaa71ddc9287d2f06ed8796df537808 | lib/valvat/locales/fr.yml | lib/valvat/locales/fr.yml | fr:
errors:
messages:
invalid_vat: "Numéro de TVA %{country_adjective} invalide"
valvat:
country_adjectives:
eu: intracommunautaire
at: autrichienne
be: belge
bg: bulgare
cy: chypriote
cz: tchèque
de: allemande
dk: danoise
ee: estonien
es: espagnole
fi: finlandaise
fr: française
gb: britannique
gr: grèque
ie: irlandaise
it: italienne
lt: lituanienne
lu: luxembourgeoise
lv: lettone
mt: maltais
nl: hollandaise
pl: polonaise
pt: portugaise
ro: roumaine
se: suédoise
si: slovène
sk: slovaque
| fr:
errors:
messages:
invalid_vat: "Numéro de TVA %{country_adjective} invalide"
valvat:
country_adjectives:
eu: intracommunautaire
at: autrichien
be: belge
bg: bulgare
cy: chypriote
cz: tchèque
de: allemand
dk: danois
ee: estonien
es: espagnol
fi: finlandais
fr: français
gb: britannique
gr: grèque
ie: irlandais
it: italien
lt: lituanien
lu: luxembourgeois
lv: letton
mt: maltais
nl: hollandais
pl: polonais
pt: portugais
ro: roumain
se: suédois
si: slovène
sk: slovaque
| Set the country adjectives to masculine in FR locales | Set the country adjectives to masculine in FR locales
as suggested in https://github.com/yolk/valvat/commit/ef33afd7892ae008c7087181cd4c62f1c4191610 | YAML | mit | yolk/valvat | yaml | ## Code Before:
fr:
errors:
messages:
invalid_vat: "Numéro de TVA %{country_adjective} invalide"
valvat:
country_adjectives:
eu: intracommunautaire
at: autrichienne
be: belge
bg: bulgare
cy: chypriote
cz: tchèque
de: allemande
dk: danoise
ee: estonien
es: espagnole
fi: finlandaise
fr: française
gb: britannique
gr: grèque
ie: irlandaise
it: italienne
lt: lituanienne
lu: luxembourgeoise
lv: lettone
mt: maltais
nl: hollandaise
pl: polonaise
pt: portugaise
ro: roumaine
se: suédoise
si: slovène
sk: slovaque
## Instruction:
Set the country adjectives to masculine in FR locales
as suggested in https://github.com/yolk/valvat/commit/ef33afd7892ae008c7087181cd4c62f1c4191610
## Code After:
fr:
errors:
messages:
invalid_vat: "Numéro de TVA %{country_adjective} invalide"
valvat:
country_adjectives:
eu: intracommunautaire
at: autrichien
be: belge
bg: bulgare
cy: chypriote
cz: tchèque
de: allemand
dk: danois
ee: estonien
es: espagnol
fi: finlandais
fr: français
gb: britannique
gr: grèque
ie: irlandais
it: italien
lt: lituanien
lu: luxembourgeois
lv: letton
mt: maltais
nl: hollandais
pl: polonais
pt: portugais
ro: roumain
se: suédois
si: slovène
sk: slovaque
| fr:
errors:
messages:
invalid_vat: "Numéro de TVA %{country_adjective} invalide"
valvat:
country_adjectives:
eu: intracommunautaire
- at: autrichienne
? --
+ at: autrichien
be: belge
bg: bulgare
cy: chypriote
cz: tchèque
- de: allemande
? -
+ de: allemand
- dk: danoise
? -
+ dk: danois
ee: estonien
- es: espagnole
? -
+ es: espagnol
- fi: finlandaise
? -
+ fi: finlandais
- fr: française
? -
+ fr: français
gb: britannique
gr: grèque
- ie: irlandaise
? -
+ ie: irlandais
- it: italienne
? --
+ it: italien
- lt: lituanienne
? --
+ lt: lituanien
- lu: luxembourgeoise
? -
+ lu: luxembourgeois
- lv: lettone
? -
+ lv: letton
mt: maltais
- nl: hollandaise
? -
+ nl: hollandais
- pl: polonaise
? -
+ pl: polonais
- pt: portugaise
? -
+ pt: portugais
- ro: roumaine
? -
+ ro: roumain
- se: suédoise
? -
+ se: suédois
si: slovène
sk: slovaque | 32 | 0.969697 | 16 | 16 |
853712ab267a68858782932dafa3f8a35538586d | www/js/directives.js | www/js/directives.js | angular.module('WatchTimer')
.directive('resizeTextToFill', function($document, $timeout) {
return {
link: function(scope, element, attrs, controller, transcludeFn) {
var initial_font_size = 10;
var font_size_increment = 20;
var safety_counter_max = 100;
function set_size(font_size) {
element.css({
fontSize: font_size + "px",
lineHeight: font_size + "px" // digits don't need more than this
});
}
function resize_to_fit() {
var font_size = initial_font_size;
var max_height = $document.height() - font_size_increment;
var max_width = $document.width() - font_size_increment;
var safety_counter = 0;
set_size(font_size);
while (
element.height() <= max_height && element.width() <= max_width && safety_counter < safety_counter_max
) {
safety_counter++;
font_size += font_size_increment;
set_size(font_size);
}
// go back down one size so we know it fits
font_size -= font_size_increment;
set_size(font_size);
}
$timeout(function() {
resize_to_fit();
});
// 'resize' as the chrome dev toolkit does not trigger an
// 'orientationchange' event when switching between oriantations.
$(window).on("resize orientationchange", resize_to_fit);
}
};
})
| angular.module('WatchTimer')
.directive('resizeTextToFill', function($window, $timeout) {
return {
link: function(scope, element, attrs, controller, transcludeFn) {
var initial_font_size = 10;
var font_size_increment = 20;
var safety_counter_max = 100;
function set_size(font_size) {
element.css({
fontSize: font_size + "px",
lineHeight: font_size + "px" // digits don't need more than this
});
}
function resize_to_fit() {
var font_size = initial_font_size;
var max_height = $($window).height() - font_size_increment;
var max_width = $($window).width() - font_size_increment;
var safety_counter = 0;
set_size(font_size);
while (
element.height() <= max_height && element.width() <= max_width && safety_counter < safety_counter_max
) {
safety_counter++;
font_size += font_size_increment;
set_size(font_size);
}
// go back down one size so we know it fits
font_size -= font_size_increment;
set_size(font_size);
}
$timeout(function() {
resize_to_fit();
});
// 'resize' as the chrome dev toolkit does not trigger an
// 'orientationchange' event when switching between oriantations.
$($window).on("resize orientationchange", resize_to_fit);
}
};
})
| Use window dimensions rather than document dimensions so the sizing is more stable | Use window dimensions rather than document dimensions so the sizing is more stable
| JavaScript | agpl-3.0 | OmniRose/omnirose-watch-timer-app,OmniRose/omnirose-watch-timer-app | javascript | ## Code Before:
angular.module('WatchTimer')
.directive('resizeTextToFill', function($document, $timeout) {
return {
link: function(scope, element, attrs, controller, transcludeFn) {
var initial_font_size = 10;
var font_size_increment = 20;
var safety_counter_max = 100;
function set_size(font_size) {
element.css({
fontSize: font_size + "px",
lineHeight: font_size + "px" // digits don't need more than this
});
}
function resize_to_fit() {
var font_size = initial_font_size;
var max_height = $document.height() - font_size_increment;
var max_width = $document.width() - font_size_increment;
var safety_counter = 0;
set_size(font_size);
while (
element.height() <= max_height && element.width() <= max_width && safety_counter < safety_counter_max
) {
safety_counter++;
font_size += font_size_increment;
set_size(font_size);
}
// go back down one size so we know it fits
font_size -= font_size_increment;
set_size(font_size);
}
$timeout(function() {
resize_to_fit();
});
// 'resize' as the chrome dev toolkit does not trigger an
// 'orientationchange' event when switching between oriantations.
$(window).on("resize orientationchange", resize_to_fit);
}
};
})
## Instruction:
Use window dimensions rather than document dimensions so the sizing is more stable
## Code After:
angular.module('WatchTimer')
.directive('resizeTextToFill', function($window, $timeout) {
return {
link: function(scope, element, attrs, controller, transcludeFn) {
var initial_font_size = 10;
var font_size_increment = 20;
var safety_counter_max = 100;
function set_size(font_size) {
element.css({
fontSize: font_size + "px",
lineHeight: font_size + "px" // digits don't need more than this
});
}
function resize_to_fit() {
var font_size = initial_font_size;
var max_height = $($window).height() - font_size_increment;
var max_width = $($window).width() - font_size_increment;
var safety_counter = 0;
set_size(font_size);
while (
element.height() <= max_height && element.width() <= max_width && safety_counter < safety_counter_max
) {
safety_counter++;
font_size += font_size_increment;
set_size(font_size);
}
// go back down one size so we know it fits
font_size -= font_size_increment;
set_size(font_size);
}
$timeout(function() {
resize_to_fit();
});
// 'resize' as the chrome dev toolkit does not trigger an
// 'orientationchange' event when switching between oriantations.
$($window).on("resize orientationchange", resize_to_fit);
}
};
})
| angular.module('WatchTimer')
- .directive('resizeTextToFill', function($document, $timeout) {
? ^^^^^^
+ .directive('resizeTextToFill', function($window, $timeout) {
? +++ ^
return {
link: function(scope, element, attrs, controller, transcludeFn) {
var initial_font_size = 10;
var font_size_increment = 20;
var safety_counter_max = 100;
function set_size(font_size) {
element.css({
fontSize: font_size + "px",
lineHeight: font_size + "px" // digits don't need more than this
});
}
function resize_to_fit() {
var font_size = initial_font_size;
- var max_height = $document.height() - font_size_increment;
? ^^^^^^
+ var max_height = $($window).height() - font_size_increment;
? +++++ ^^
- var max_width = $document.width() - font_size_increment;
? ^^^^^^
+ var max_width = $($window).width() - font_size_increment;
? +++++ ^^
var safety_counter = 0;
set_size(font_size);
while (
element.height() <= max_height && element.width() <= max_width && safety_counter < safety_counter_max
) {
safety_counter++;
font_size += font_size_increment;
set_size(font_size);
}
// go back down one size so we know it fits
font_size -= font_size_increment;
set_size(font_size);
}
$timeout(function() {
resize_to_fit();
});
// 'resize' as the chrome dev toolkit does not trigger an
// 'orientationchange' event when switching between oriantations.
- $(window).on("resize orientationchange", resize_to_fit);
+ $($window).on("resize orientationchange", resize_to_fit);
? +
}
};
}) | 8 | 0.163265 | 4 | 4 |
ab01a2bd62886b4f9dfc4ad85c6c85d8bff9112e | src/constants.js | src/constants.js | export const WEATHER_API_URL = 'http://api.openweathermap.org/data/2.5';
export const WEATHER_APP_ID = process.env.REACT_APP_WEATHER_APP_ID;
// Please replace with your app id from open weather map org. You can sign up at `https://home.openweathermap.org/users/sign_up`.
| export const WEATHER_API_URL = 'https://cors-anywhere.herokuapp.com/http://api.openweathermap.org/data/2.5';
export const WEATHER_APP_ID = process.env.REACT_APP_WEATHER_APP_ID;
// Please replace with your app id from open weather map org. You can sign up at `https://home.openweathermap.org/users/sign_up`.
| Work around the core issue with the api http endpoint | Work around the core issue with the api http endpoint
| JavaScript | mit | tienwei/weather-app,tienwei/weather-app | javascript | ## Code Before:
export const WEATHER_API_URL = 'http://api.openweathermap.org/data/2.5';
export const WEATHER_APP_ID = process.env.REACT_APP_WEATHER_APP_ID;
// Please replace with your app id from open weather map org. You can sign up at `https://home.openweathermap.org/users/sign_up`.
## Instruction:
Work around the core issue with the api http endpoint
## Code After:
export const WEATHER_API_URL = 'https://cors-anywhere.herokuapp.com/http://api.openweathermap.org/data/2.5';
export const WEATHER_APP_ID = process.env.REACT_APP_WEATHER_APP_ID;
// Please replace with your app id from open weather map org. You can sign up at `https://home.openweathermap.org/users/sign_up`.
| - export const WEATHER_API_URL = 'http://api.openweathermap.org/data/2.5';
+ export const WEATHER_API_URL = 'https://cors-anywhere.herokuapp.com/http://api.openweathermap.org/data/2.5';
? ++++++++++++++++++++++++++++++++++++
export const WEATHER_APP_ID = process.env.REACT_APP_WEATHER_APP_ID;
// Please replace with your app id from open weather map org. You can sign up at `https://home.openweathermap.org/users/sign_up`. | 2 | 0.666667 | 1 | 1 |
d852356e932a5112308a8c65c1ff6f14019a6835 | factory/tools/cat_StarterLog.py | factory/tools/cat_StarterLog.py |
import os.path
import sys
STARTUP_DIR=sys.path[0]
sys.path.append(os.path.join(STARTUP_DIR,"lib"))
import gWftLogParser
USAGE="Usage: cat_StarterLog.py <logname>"
def main():
try:
print gWftLogParser.get_CondorLog(sys.argv[1],"((StarterLog)|(StarterLog.vm2))")
except:
sys.stderr.write("%s\n"%USAGE)
sys.exit(1)
if __name__ == '__main__':
main()
|
import os.path
import sys
STARTUP_DIR=sys.path[0]
sys.path.append(os.path.join(STARTUP_DIR,"lib"))
import gWftLogParser
USAGE="Usage: cat_StarterLog.py [-monitor] <logname>"
def main():
if sys.argv[1]=='-monitor':
fname=sys.argv[2]
condor_log_id="((StarterLog.monitor)|(StarterLog.vm1))"
else:
fname=sys.argv[1]
condor_log_id="((StarterLog)|(StarterLog.vm2))"
try:
print gWftLogParser.get_CondorLog(sys.argv[1],"((StarterLog)|(StarterLog.vm2))")
except:
sys.stderr.write("%s\n"%USAGE)
sys.exit(1)
if __name__ == '__main__':
main()
| Add support for monitor starterlog | Add support for monitor starterlog
| Python | bsd-3-clause | holzman/glideinwms-old,holzman/glideinwms-old,bbockelm/glideinWMS,bbockelm/glideinWMS,bbockelm/glideinWMS,holzman/glideinwms-old,bbockelm/glideinWMS | python | ## Code Before:
import os.path
import sys
STARTUP_DIR=sys.path[0]
sys.path.append(os.path.join(STARTUP_DIR,"lib"))
import gWftLogParser
USAGE="Usage: cat_StarterLog.py <logname>"
def main():
try:
print gWftLogParser.get_CondorLog(sys.argv[1],"((StarterLog)|(StarterLog.vm2))")
except:
sys.stderr.write("%s\n"%USAGE)
sys.exit(1)
if __name__ == '__main__':
main()
## Instruction:
Add support for monitor starterlog
## Code After:
import os.path
import sys
STARTUP_DIR=sys.path[0]
sys.path.append(os.path.join(STARTUP_DIR,"lib"))
import gWftLogParser
USAGE="Usage: cat_StarterLog.py [-monitor] <logname>"
def main():
if sys.argv[1]=='-monitor':
fname=sys.argv[2]
condor_log_id="((StarterLog.monitor)|(StarterLog.vm1))"
else:
fname=sys.argv[1]
condor_log_id="((StarterLog)|(StarterLog.vm2))"
try:
print gWftLogParser.get_CondorLog(sys.argv[1],"((StarterLog)|(StarterLog.vm2))")
except:
sys.stderr.write("%s\n"%USAGE)
sys.exit(1)
if __name__ == '__main__':
main()
|
import os.path
import sys
STARTUP_DIR=sys.path[0]
sys.path.append(os.path.join(STARTUP_DIR,"lib"))
import gWftLogParser
- USAGE="Usage: cat_StarterLog.py <logname>"
+ USAGE="Usage: cat_StarterLog.py [-monitor] <logname>"
? +++++++++++
def main():
+ if sys.argv[1]=='-monitor':
+ fname=sys.argv[2]
+ condor_log_id="((StarterLog.monitor)|(StarterLog.vm1))"
+ else:
+ fname=sys.argv[1]
+ condor_log_id="((StarterLog)|(StarterLog.vm2))"
+
try:
print gWftLogParser.get_CondorLog(sys.argv[1],"((StarterLog)|(StarterLog.vm2))")
except:
sys.stderr.write("%s\n"%USAGE)
sys.exit(1)
if __name__ == '__main__':
main()
| 9 | 0.45 | 8 | 1 |
9ab19f796e4f946f102fac81d469331c7de464b0 | spec/classes/init_spec.rb | spec/classes/init_spec.rb | require 'spec_helper'
describe 'patchwork' do
context 'with defaults for all parameters' do
it { should contain_class('patchwork') }
end
end
| require 'spec_helper'
describe 'patchwork', :type => 'class' do
context 'with defaults for all parameters' do
let (:facts) do {
:osfamily => 'RedHat',
:operatingsystem => 'CentOS',
}
end
it { should contain_class('patchwork') }
it { should contain_package('git').with_ensure('installed') }
it do
should contain_vcsrepo('/opt/patchwork').with(
'ensure' => 'present',
'provider' => 'git',
'source' => 'git://github.com/getpatchwork/patchwork',
)
end
end
end
| Define facts in init spec test | Define facts in init spec test
Without any facts defined for the OS, epel, python, and other modules
fail to compile causing the tests to fail.
Signed-off-by: Trevor Bramwell <9318f446584e3f6cf68dea37a1a9fde63cb30ce1@linuxfoundation.org>
| Ruby | apache-2.0 | bramwelt/puppet-patchwork,bramwelt/puppet-patchwork,bramwelt/puppet-patchwork | ruby | ## Code Before:
require 'spec_helper'
describe 'patchwork' do
context 'with defaults for all parameters' do
it { should contain_class('patchwork') }
end
end
## Instruction:
Define facts in init spec test
Without any facts defined for the OS, epel, python, and other modules
fail to compile causing the tests to fail.
Signed-off-by: Trevor Bramwell <9318f446584e3f6cf68dea37a1a9fde63cb30ce1@linuxfoundation.org>
## Code After:
require 'spec_helper'
describe 'patchwork', :type => 'class' do
context 'with defaults for all parameters' do
let (:facts) do {
:osfamily => 'RedHat',
:operatingsystem => 'CentOS',
}
end
it { should contain_class('patchwork') }
it { should contain_package('git').with_ensure('installed') }
it do
should contain_vcsrepo('/opt/patchwork').with(
'ensure' => 'present',
'provider' => 'git',
'source' => 'git://github.com/getpatchwork/patchwork',
)
end
end
end
| require 'spec_helper'
- describe 'patchwork' do
+ describe 'patchwork', :type => 'class' do
context 'with defaults for all parameters' do
+ let (:facts) do {
+ :osfamily => 'RedHat',
+ :operatingsystem => 'CentOS',
+ }
+ end
+
it { should contain_class('patchwork') }
+
+ it { should contain_package('git').with_ensure('installed') }
+
+ it do
+ should contain_vcsrepo('/opt/patchwork').with(
+ 'ensure' => 'present',
+ 'provider' => 'git',
+ 'source' => 'git://github.com/getpatchwork/patchwork',
+ )
+ end
end
end | 18 | 2.571429 | 17 | 1 |
7a44ce6ec779f5e36cf9965060fed1de56a88ddc | .travis.yml | .travis.yml | sudo: false
language: python
python:
- "3.4"
- "3.5"
- "3.6"
- "3.7"
install:
- pip install tox-travis
- python setup.py install
script:
- tox
| sudo: false
language: python
python:
- "3.4"
- "3.5"
- "3.6"
install:
- pip install tox-travis
- python setup.py install
script:
- tox
matrix:
include:
- python: 3.7
dist: xenial
sudo: true
| Apply fix for TravisCI + Py3.7 | Apply fix for TravisCI + Py3.7
See comment https://github.com/travis-ci/travis-ci/issues/9069#issuecomment-425720905
| YAML | apache-2.0 | linkedin/JTune | yaml | ## Code Before:
sudo: false
language: python
python:
- "3.4"
- "3.5"
- "3.6"
- "3.7"
install:
- pip install tox-travis
- python setup.py install
script:
- tox
## Instruction:
Apply fix for TravisCI + Py3.7
See comment https://github.com/travis-ci/travis-ci/issues/9069#issuecomment-425720905
## Code After:
sudo: false
language: python
python:
- "3.4"
- "3.5"
- "3.6"
install:
- pip install tox-travis
- python setup.py install
script:
- tox
matrix:
include:
- python: 3.7
dist: xenial
sudo: true
| sudo: false
language: python
python:
- "3.4"
- "3.5"
- "3.6"
- - "3.7"
install:
- pip install tox-travis
- python setup.py install
script:
- tox
+ matrix:
+ include:
+ - python: 3.7
+ dist: xenial
+ sudo: true | 6 | 0.5 | 5 | 1 |
ad315659a48175b2875adc400413808a68d951ca | src/libaten/types.h | src/libaten/types.h |
//#define TYPE_DOUBLE
#ifdef TYPE_DOUBLE
using real = double;
#else
using real = float;
#endif
|
//#define TYPE_DOUBLE
#ifdef TYPE_DOUBLE
using real = double;
#define AT_IS_TYPE_DOUBLE (true)
#else
using real = float;
#define AT_IS_TYPE_DOUBLE (false)
#endif
| Add macro to know if "real" is double. | Add macro to know if "real" is double.
| C | mit | nakdai/aten,nakdai/aten | c | ## Code Before:
//#define TYPE_DOUBLE
#ifdef TYPE_DOUBLE
using real = double;
#else
using real = float;
#endif
## Instruction:
Add macro to know if "real" is double.
## Code After:
//#define TYPE_DOUBLE
#ifdef TYPE_DOUBLE
using real = double;
#define AT_IS_TYPE_DOUBLE (true)
#else
using real = float;
#define AT_IS_TYPE_DOUBLE (false)
#endif
|
//#define TYPE_DOUBLE
#ifdef TYPE_DOUBLE
using real = double;
+ #define AT_IS_TYPE_DOUBLE (true)
#else
using real = float;
+ #define AT_IS_TYPE_DOUBLE (false)
#endif
| 2 | 0.222222 | 2 | 0 |
bddeeced3bb95f1af5c411dc3232522ea5248ab5 | contract-spring/src/main/java/com/github/sebhoss/contract/configuration/DefaultSpringConfiguration.java | contract-spring/src/main/java/com/github/sebhoss/contract/configuration/DefaultSpringConfiguration.java | /*
* Copyright © 2012 Sebastian Hoß <mail@shoss.de>
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
*/
package com.github.sebhoss.contract.configuration;
import com.github.sebhoss.contract.verifier.ParameterNamesLookupConfiguration;
import com.github.sebhoss.contract.verifier.SpringElConfiguration;
import com.github.sebhoss.contract.verifier.impl.ErrorMessageConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.Import;
/**
* Default configuration for Spring-based projects.
*/
@Configuration
@EnableAspectJAutoProxy
@Import({ ParameterNamesLookupConfiguration.class, SpringElConfiguration.class, ErrorMessageConfiguration.class })
public class DefaultSpringConfiguration {
// Meta-configuration
}
| /*
* Copyright © 2012 Sebastian Hoß <mail@shoss.de>
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
*/
package com.github.sebhoss.contract.configuration;
import com.github.sebhoss.contract.verifier.ParameterNamesLookupConfiguration;
import com.github.sebhoss.contract.verifier.SpringElConfiguration;
import com.github.sebhoss.contract.verifier.impl.ErrorMessageConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.Import;
/**
* Default configuration for Spring-based projects.
*/
@Configuration
@EnableAspectJAutoProxy(proxyTargetClass = true)
@Import({ ParameterNamesLookupConfiguration.class, SpringElConfiguration.class, ErrorMessageConfiguration.class })
public class DefaultSpringConfiguration {
// Meta-configuration
}
| Enable proxy classes for parameter names | Enable proxy classes for parameter names
Signed-off-by: Sebastian Hoß <1d6e1cf70ec6f9ab28d3ea4b27a49a77654d370e@shoss.de> | Java | unlicense | sebhoss/annotated-contracts | java | ## Code Before:
/*
* Copyright © 2012 Sebastian Hoß <mail@shoss.de>
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
*/
package com.github.sebhoss.contract.configuration;
import com.github.sebhoss.contract.verifier.ParameterNamesLookupConfiguration;
import com.github.sebhoss.contract.verifier.SpringElConfiguration;
import com.github.sebhoss.contract.verifier.impl.ErrorMessageConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.Import;
/**
* Default configuration for Spring-based projects.
*/
@Configuration
@EnableAspectJAutoProxy
@Import({ ParameterNamesLookupConfiguration.class, SpringElConfiguration.class, ErrorMessageConfiguration.class })
public class DefaultSpringConfiguration {
// Meta-configuration
}
## Instruction:
Enable proxy classes for parameter names
Signed-off-by: Sebastian Hoß <1d6e1cf70ec6f9ab28d3ea4b27a49a77654d370e@shoss.de>
## Code After:
/*
* Copyright © 2012 Sebastian Hoß <mail@shoss.de>
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
*/
package com.github.sebhoss.contract.configuration;
import com.github.sebhoss.contract.verifier.ParameterNamesLookupConfiguration;
import com.github.sebhoss.contract.verifier.SpringElConfiguration;
import com.github.sebhoss.contract.verifier.impl.ErrorMessageConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.Import;
/**
* Default configuration for Spring-based projects.
*/
@Configuration
@EnableAspectJAutoProxy(proxyTargetClass = true)
@Import({ ParameterNamesLookupConfiguration.class, SpringElConfiguration.class, ErrorMessageConfiguration.class })
public class DefaultSpringConfiguration {
// Meta-configuration
}
| /*
* Copyright © 2012 Sebastian Hoß <mail@shoss.de>
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
*/
package com.github.sebhoss.contract.configuration;
import com.github.sebhoss.contract.verifier.ParameterNamesLookupConfiguration;
import com.github.sebhoss.contract.verifier.SpringElConfiguration;
import com.github.sebhoss.contract.verifier.impl.ErrorMessageConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.Import;
/**
* Default configuration for Spring-based projects.
*/
@Configuration
- @EnableAspectJAutoProxy
+ @EnableAspectJAutoProxy(proxyTargetClass = true)
@Import({ ParameterNamesLookupConfiguration.class, SpringElConfiguration.class, ErrorMessageConfiguration.class })
public class DefaultSpringConfiguration {
// Meta-configuration
} | 2 | 0.074074 | 1 | 1 |
32582e21dd5856a866d4e9d7dec2e1f2428f1d61 | appveyor.yml | appveyor.yml | build: false
environment:
matrix:
- TOXENV: "py27"
- TOXENV: "py33"
- TOXENV: "py34"
- TOXENV: "flake827"
- TOXENV: "flake834"
init:
- "ECHO %TOXENV%"
- ps: "ls C:\\Python*"
install:
- ps: Invoke-WebRequest "https://bootstrap.pypa.io/get-pip.py" -OutFile "c:\\get-pip.py"
- "c:\\python27\\python c:\\get-pip.py"
- "c:\\python27\\Scripts\\pip install tox virtualenv"
test_script:
- "c:\\python27\\Scripts\\tox --version"
- "c:\\python27\\Scripts\\virtualenv --version"
- "c:\\python27\\Scripts\\pip --version"
- "c:\\python27\\Scripts\\tox"
| build: false
environment:
matrix:
- TOXENV: "py26"
- TOXENV: "py27"
- TOXENV: "py33"
- TOXENV: "py34"
- TOXENV: "py35"
- TOXENV: "flake827"
- TOXENV: "flake834"
init:
- "ECHO %TOXENV%"
- ps: "ls C:\\Python*"
install:
- ps: Invoke-WebRequest "https://bootstrap.pypa.io/get-pip.py" -OutFile "c:\\get-pip.py"
- "c:\\python27\\python c:\\get-pip.py"
- "c:\\python27\\Scripts\\pip install tox virtualenv"
test_script:
- "c:\\python27\\Scripts\\tox --version"
- "c:\\python27\\Scripts\\virtualenv --version"
- "c:\\python27\\Scripts\\pip --version"
- "c:\\python27\\Scripts\\tox"
| Add 2.6 and 3.5 to Appveyor setup. | Add 2.6 and 3.5 to Appveyor setup.
| YAML | mit | jezdez/envdir | yaml | ## Code Before:
build: false
environment:
matrix:
- TOXENV: "py27"
- TOXENV: "py33"
- TOXENV: "py34"
- TOXENV: "flake827"
- TOXENV: "flake834"
init:
- "ECHO %TOXENV%"
- ps: "ls C:\\Python*"
install:
- ps: Invoke-WebRequest "https://bootstrap.pypa.io/get-pip.py" -OutFile "c:\\get-pip.py"
- "c:\\python27\\python c:\\get-pip.py"
- "c:\\python27\\Scripts\\pip install tox virtualenv"
test_script:
- "c:\\python27\\Scripts\\tox --version"
- "c:\\python27\\Scripts\\virtualenv --version"
- "c:\\python27\\Scripts\\pip --version"
- "c:\\python27\\Scripts\\tox"
## Instruction:
Add 2.6 and 3.5 to Appveyor setup.
## Code After:
build: false
environment:
matrix:
- TOXENV: "py26"
- TOXENV: "py27"
- TOXENV: "py33"
- TOXENV: "py34"
- TOXENV: "py35"
- TOXENV: "flake827"
- TOXENV: "flake834"
init:
- "ECHO %TOXENV%"
- ps: "ls C:\\Python*"
install:
- ps: Invoke-WebRequest "https://bootstrap.pypa.io/get-pip.py" -OutFile "c:\\get-pip.py"
- "c:\\python27\\python c:\\get-pip.py"
- "c:\\python27\\Scripts\\pip install tox virtualenv"
test_script:
- "c:\\python27\\Scripts\\tox --version"
- "c:\\python27\\Scripts\\virtualenv --version"
- "c:\\python27\\Scripts\\pip --version"
- "c:\\python27\\Scripts\\tox"
| build: false
environment:
matrix:
+ - TOXENV: "py26"
- TOXENV: "py27"
- TOXENV: "py33"
- TOXENV: "py34"
+ - TOXENV: "py35"
- TOXENV: "flake827"
- TOXENV: "flake834"
init:
- "ECHO %TOXENV%"
- ps: "ls C:\\Python*"
install:
- ps: Invoke-WebRequest "https://bootstrap.pypa.io/get-pip.py" -OutFile "c:\\get-pip.py"
- "c:\\python27\\python c:\\get-pip.py"
- "c:\\python27\\Scripts\\pip install tox virtualenv"
test_script:
- "c:\\python27\\Scripts\\tox --version"
- "c:\\python27\\Scripts\\virtualenv --version"
- "c:\\python27\\Scripts\\pip --version"
- "c:\\python27\\Scripts\\tox" | 2 | 0.1 | 2 | 0 |
ea1a61831c159473f7ab33f0cd5196e9cb9e4297 | Tests/LinuxMain.swift | Tests/LinuxMain.swift |
import XCTest
@testable import AppLogicTests
XCTMain([
// AppLogicTests
testCase(RouteTests.allTests),
testCase(V1PublicCollectionTests.allTests),
testCase(V1AdminCollectionTests.allTests)
])
#endif
|
import XCTest
@testable import AppLogicTests
XCTMain([
// AppLogicTests
testCase(RouteTests.allTests),
testCase(V1PublicCollectionTests.allTests),
testCase(V1ManageCollectionTests.allTests),
testCase(V1AdminCollectionTests.allTests)
])
#endif
| Add manage v1 tests in test suit for Linux | Add manage v1 tests in test suit for Linux
| Swift | mit | Stosyk/stosyk-service | swift | ## Code Before:
import XCTest
@testable import AppLogicTests
XCTMain([
// AppLogicTests
testCase(RouteTests.allTests),
testCase(V1PublicCollectionTests.allTests),
testCase(V1AdminCollectionTests.allTests)
])
#endif
## Instruction:
Add manage v1 tests in test suit for Linux
## Code After:
import XCTest
@testable import AppLogicTests
XCTMain([
// AppLogicTests
testCase(RouteTests.allTests),
testCase(V1PublicCollectionTests.allTests),
testCase(V1ManageCollectionTests.allTests),
testCase(V1AdminCollectionTests.allTests)
])
#endif
|
import XCTest
@testable import AppLogicTests
XCTMain([
// AppLogicTests
testCase(RouteTests.allTests),
testCase(V1PublicCollectionTests.allTests),
+ testCase(V1ManageCollectionTests.allTests),
testCase(V1AdminCollectionTests.allTests)
])
#endif | 1 | 0.083333 | 1 | 0 |
c47fb6a4d38517663da1d71536117a149b42f849 | bot.js | bot.js | const fs = require('fs');
const path = require('path');
const lexicon = [];
{
const directory = path.join(__dirname, 'lexicon');
fs.readdirSync(directory).forEach(function(file) {
const entry = require(path.join(directory, file));
lexicon.push(entry);
});
}
const parse = function parse(message, reply) {
if (!message || !message.text) return;
const [ ,,input ] = message.text.match(/^lex(icon)?\s(.+)/) || [];
if (input === undefined) return;
lexicon.forEach(function(entry) {
const match = input.match(new RegExp('^' + entry.pattern, 'i'));
if (match) entry.reply(message, match, reply);
});
};
module.exports = { parse };
| const fs = require('fs');
const path = require('path');
const lexicon = [];
{
const directory = path.join(__dirname, 'lexicon');
fs.readdirSync(directory).forEach(function(file) {
const entry = require(path.join(directory, file));
lexicon.push(entry);
});
}
const parse = function parse(message, reply) {
if (!message || !message.text) return;
let [ prefix,,,input ] = message.text.match(/^lex(icon)?(\s(.+)|\s$|$)/) || [];
if (!prefix) return;
if (!input) input = 'help';
lexicon.forEach(function(entry) {
if (!entry.pattern) return true;
const match = input.match(new RegExp('^' + entry.pattern, 'i'));
if (match) entry.reply(message, match, reply);
});
};
module.exports = { parse };
| Fix help message when command is empty | Fix help message when command is empty
| JavaScript | mit | esoui/lexicon,esoui/lexicon | javascript | ## Code Before:
const fs = require('fs');
const path = require('path');
const lexicon = [];
{
const directory = path.join(__dirname, 'lexicon');
fs.readdirSync(directory).forEach(function(file) {
const entry = require(path.join(directory, file));
lexicon.push(entry);
});
}
const parse = function parse(message, reply) {
if (!message || !message.text) return;
const [ ,,input ] = message.text.match(/^lex(icon)?\s(.+)/) || [];
if (input === undefined) return;
lexicon.forEach(function(entry) {
const match = input.match(new RegExp('^' + entry.pattern, 'i'));
if (match) entry.reply(message, match, reply);
});
};
module.exports = { parse };
## Instruction:
Fix help message when command is empty
## Code After:
const fs = require('fs');
const path = require('path');
const lexicon = [];
{
const directory = path.join(__dirname, 'lexicon');
fs.readdirSync(directory).forEach(function(file) {
const entry = require(path.join(directory, file));
lexicon.push(entry);
});
}
const parse = function parse(message, reply) {
if (!message || !message.text) return;
let [ prefix,,,input ] = message.text.match(/^lex(icon)?(\s(.+)|\s$|$)/) || [];
if (!prefix) return;
if (!input) input = 'help';
lexicon.forEach(function(entry) {
if (!entry.pattern) return true;
const match = input.match(new RegExp('^' + entry.pattern, 'i'));
if (match) entry.reply(message, match, reply);
});
};
module.exports = { parse };
| const fs = require('fs');
const path = require('path');
const lexicon = [];
{
const directory = path.join(__dirname, 'lexicon');
fs.readdirSync(directory).forEach(function(file) {
const entry = require(path.join(directory, file));
lexicon.push(entry);
});
}
const parse = function parse(message, reply) {
if (!message || !message.text) return;
- const [ ,,input ] = message.text.match(/^lex(icon)?\s(.+)/) || [];
? ^^^^
+ let [ prefix,,,input ] = message.text.match(/^lex(icon)?(\s(.+)|\s$|$)/) || [];
? ^^ +++++++ + +++++++
- if (input === undefined) return;
+ if (!prefix) return;
+ if (!input) input = 'help';
lexicon.forEach(function(entry) {
+ if (!entry.pattern) return true;
const match = input.match(new RegExp('^' + entry.pattern, 'i'));
if (match) entry.reply(message, match, reply);
});
};
module.exports = { parse }; | 6 | 0.24 | 4 | 2 |
84e66aa7011d7b3ebcc8e4d204f9115a2151bafd | backend/servers/mcapid/actions/templates-actions.js | backend/servers/mcapid/actions/templates-actions.js | const {Action, api} = require('actionhero');
const templates = require('../lib/dal/templates');
module.exports.allTemplatesPublic = class TopViewedPublishedDatasetsAction extends Action {
constructor() {
super();
this.name = 'allTemplatesPublic';
this.description = 'Returns all public templages';
this.do_not_authenticate = true;
}
async run({response}) {
api.log("Call to get all templates",'info');
response.data = await templates.getAllTemplates();
api.log("Results of get all templates",'info',response.data.length);
}
}; | const {Action} = require('actionhero');
const templates = require('../lib/dal/templates');
module.exports.GetAllPublicTemplatesAction = class GetAllPublicTemplatesAction extends Action {
constructor() {
super();
this.name = 'getAllPublicTemplates';
this.description = 'Returns all public templates';
this.do_not_authenticate = true;
}
async run({response}) {
response.data = await templates.getAllTemplates();
}
}; | Change templates action to follow our naming convention | Change templates action to follow our naming convention
| JavaScript | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | javascript | ## Code Before:
const {Action, api} = require('actionhero');
const templates = require('../lib/dal/templates');
module.exports.allTemplatesPublic = class TopViewedPublishedDatasetsAction extends Action {
constructor() {
super();
this.name = 'allTemplatesPublic';
this.description = 'Returns all public templages';
this.do_not_authenticate = true;
}
async run({response}) {
api.log("Call to get all templates",'info');
response.data = await templates.getAllTemplates();
api.log("Results of get all templates",'info',response.data.length);
}
};
## Instruction:
Change templates action to follow our naming convention
## Code After:
const {Action} = require('actionhero');
const templates = require('../lib/dal/templates');
module.exports.GetAllPublicTemplatesAction = class GetAllPublicTemplatesAction extends Action {
constructor() {
super();
this.name = 'getAllPublicTemplates';
this.description = 'Returns all public templates';
this.do_not_authenticate = true;
}
async run({response}) {
response.data = await templates.getAllTemplates();
}
}; | - const {Action, api} = require('actionhero');
? -----
+ const {Action} = require('actionhero');
const templates = require('../lib/dal/templates');
-
- module.exports.allTemplatesPublic = class TopViewedPublishedDatasetsAction extends Action {
? ^ ^^^^ ^ ^^^^^ ^^^ ^^ ^^ -- -
+ module.exports.GetAllPublicTemplatesAction = class GetAllPublicTemplatesAction extends Action {
? ^^^^ ++++++ ^^^ ^^ ^ ^^^^ ^^ ^^^
constructor() {
super();
- this.name = 'allTemplatesPublic';
? ^ ------
+ this.name = 'getAllPublicTemplates';
? ^^^^ ++++++
- this.description = 'Returns all public templages';
? ^
+ this.description = 'Returns all public templates';
? ^
this.do_not_authenticate = true;
}
async run({response}) {
- api.log("Call to get all templates",'info');
response.data = await templates.getAllTemplates();
- api.log("Results of get all templates",'info',response.data.length);
}
}; | 11 | 0.611111 | 4 | 7 |
836eac5994151eb4c8ffe65d7b3daeab174e16e8 | packages/ne/netclock.yaml | packages/ne/netclock.yaml | homepage: http://netclock.slab.org/
changelog-type: ''
hash: 3ebe821748a82274e455b964bddaf5e3a24b1a2761030cf4ae9ba890745da38d
test-bench-deps: {}
maintainer: netclock@mail.slab.org
synopsis: Netclock protocol
changelog: ''
basic-deps:
bytestring: -any
base: <5
network: -any
hosc: ! '>=0.7'
all-versions:
- '0.1'
- '0.2'
- '0.3'
- '0.4'
- '0.5'
- '0.6'
author: Alex McLean
latest: '0.6'
description-type: haddock
description: Implementation of the Netclock protocol for sharing clocks in music performance
license-name: GPL-3
| homepage: http://netclock.slab.org/
changelog-type: ''
hash: 08ec29a817c1ff0971d69342311cbb2017b5f1cbb8a88e32a81059696dca9803
test-bench-deps: {}
maintainer: netclock@mail.slab.org
synopsis: Netclock protocol
changelog: ''
basic-deps:
bytestring: -any
base: <5
network: -any
hosc: ! '>=0.14 && <0.16'
all-versions:
- '0.1'
- '0.2'
- '0.3'
- '0.4'
- '0.5'
- '0.6'
author: Alex McLean
latest: '0.6'
description-type: haddock
description: Implementation of the Netclock protocol for sharing clocks in music performance
license-name: GPL-3
| Update from Hackage at 2018-08-12T22:41:58Z | Update from Hackage at 2018-08-12T22:41:58Z
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: http://netclock.slab.org/
changelog-type: ''
hash: 3ebe821748a82274e455b964bddaf5e3a24b1a2761030cf4ae9ba890745da38d
test-bench-deps: {}
maintainer: netclock@mail.slab.org
synopsis: Netclock protocol
changelog: ''
basic-deps:
bytestring: -any
base: <5
network: -any
hosc: ! '>=0.7'
all-versions:
- '0.1'
- '0.2'
- '0.3'
- '0.4'
- '0.5'
- '0.6'
author: Alex McLean
latest: '0.6'
description-type: haddock
description: Implementation of the Netclock protocol for sharing clocks in music performance
license-name: GPL-3
## Instruction:
Update from Hackage at 2018-08-12T22:41:58Z
## Code After:
homepage: http://netclock.slab.org/
changelog-type: ''
hash: 08ec29a817c1ff0971d69342311cbb2017b5f1cbb8a88e32a81059696dca9803
test-bench-deps: {}
maintainer: netclock@mail.slab.org
synopsis: Netclock protocol
changelog: ''
basic-deps:
bytestring: -any
base: <5
network: -any
hosc: ! '>=0.14 && <0.16'
all-versions:
- '0.1'
- '0.2'
- '0.3'
- '0.4'
- '0.5'
- '0.6'
author: Alex McLean
latest: '0.6'
description-type: haddock
description: Implementation of the Netclock protocol for sharing clocks in music performance
license-name: GPL-3
| homepage: http://netclock.slab.org/
changelog-type: ''
- hash: 3ebe821748a82274e455b964bddaf5e3a24b1a2761030cf4ae9ba890745da38d
+ hash: 08ec29a817c1ff0971d69342311cbb2017b5f1cbb8a88e32a81059696dca9803
test-bench-deps: {}
maintainer: netclock@mail.slab.org
synopsis: Netclock protocol
changelog: ''
basic-deps:
bytestring: -any
base: <5
network: -any
- hosc: ! '>=0.7'
+ hosc: ! '>=0.14 && <0.16'
all-versions:
- '0.1'
- '0.2'
- '0.3'
- '0.4'
- '0.5'
- '0.6'
author: Alex McLean
latest: '0.6'
description-type: haddock
description: Implementation of the Netclock protocol for sharing clocks in music performance
license-name: GPL-3 | 4 | 0.166667 | 2 | 2 |
cb4749b3607ebe4333b7efab37ae0e176db362ac | tests/full-version-label.sh | tests/full-version-label.sh | set -eo pipefail
# The purpose of this test is to ensure that the output of the "nodeos --full-version" command matches the version string defined by our CMake files
echo '##### Nodeos Full Version Label Test #####'
# orient ourselves
[[ -z "$BUILD_ROOT" ]] && export BUILD_ROOT="$(pwd)"
echo "Using BUILD_ROOT=\"$BUILD_ROOT\"."
[[ -z "$CMAKE_SOURCE_DIR" ]] && export CMAKE_SOURCE_DIR="$2"
EXPECTED=$1
if [[ -z "$EXPECTED" ]]; then
echo "Missing version input."
exit 1
fi
VERSION_HASH="$(pushd "$CMAKE_SOURCE_DIR" &>/dev/null && git rev-parse HEAD 2>/dev/null ; popd &>/dev/null)"
EXPECTED=v$EXPECTED-$VERSION_HASH
echo "Expecting \"$EXPECTED\"..."
# get nodeos version
ACTUAL=$($BUILD_ROOT/bin/nodeos --full-version)
EXIT_CODE=$?
# verify 0 exit code explicitly
if [[ $EXIT_CODE -ne 0 ]]; then
echo "Nodeos produced non-zero exit code \"$EXIT_CODE\"."
exit $EXIT_CODE
fi
# test version
if [[ "$EXPECTED" == "$ACTUAL" ]]; then
echo "Passed with \"$ACTUAL\"."
exit 0
fi
echo 'Failed!'
echo "\"$EXPECTED\" != \"$ACTUAL\""
exit 1
| set -eo pipefail
# The purpose of this test is to ensure that the output of the "nodeos --full-version" command matches the version string defined by our CMake files
echo '##### Nodeos Full Version Label Test #####'
# orient ourselves
[[ -z "$BUILD_ROOT" ]] && export BUILD_ROOT="$(pwd)"
echo "Using BUILD_ROOT=\"$BUILD_ROOT\"."
[[ -z "$CMAKE_SOURCE_DIR" ]] && export CMAKE_SOURCE_DIR="$2"
EXPECTED=$1
if [[ -z "$EXPECTED" ]]; then
echo "Missing version input."
exit 1
fi
[[ -z "$BUILDKITE_COMMIT" ]] && export BUILDKITE_COMMIT="$(pushd "$CMAKE_SOURCE_DIR" &>/dev/null && git rev-parse HEAD 2>/dev/null ; popd &>/dev/null)"
EXPECTED=v$EXPECTED-$BUILDKITE_COMMIT
echo "Expecting \"$EXPECTED\"..."
# get nodeos version
ACTUAL=$($BUILD_ROOT/bin/nodeos --full-version)
EXIT_CODE=$?
# verify 0 exit code explicitly
if [[ $EXIT_CODE -ne 0 ]]; then
echo "Nodeos produced non-zero exit code \"$EXIT_CODE\"."
exit $EXIT_CODE
fi
# test version
if [[ "$EXPECTED" == "$ACTUAL" ]]; then
echo "Passed with \"$ACTUAL\"."
exit 0
fi
echo 'Failed!'
echo "\"$EXPECTED\" != \"$ACTUAL\""
exit 1
| Support getting the commit hash without invoking git, for testing --full-version on a clean Linux install | Support getting the commit hash without invoking git, for testing --full-version on a clean Linux install
| Shell | mit | EOSIO/eos,EOSIO/eos,EOSIO/eos,EOSIO/eos,EOSIO/eos | shell | ## Code Before:
set -eo pipefail
# The purpose of this test is to ensure that the output of the "nodeos --full-version" command matches the version string defined by our CMake files
echo '##### Nodeos Full Version Label Test #####'
# orient ourselves
[[ -z "$BUILD_ROOT" ]] && export BUILD_ROOT="$(pwd)"
echo "Using BUILD_ROOT=\"$BUILD_ROOT\"."
[[ -z "$CMAKE_SOURCE_DIR" ]] && export CMAKE_SOURCE_DIR="$2"
EXPECTED=$1
if [[ -z "$EXPECTED" ]]; then
echo "Missing version input."
exit 1
fi
VERSION_HASH="$(pushd "$CMAKE_SOURCE_DIR" &>/dev/null && git rev-parse HEAD 2>/dev/null ; popd &>/dev/null)"
EXPECTED=v$EXPECTED-$VERSION_HASH
echo "Expecting \"$EXPECTED\"..."
# get nodeos version
ACTUAL=$($BUILD_ROOT/bin/nodeos --full-version)
EXIT_CODE=$?
# verify 0 exit code explicitly
if [[ $EXIT_CODE -ne 0 ]]; then
echo "Nodeos produced non-zero exit code \"$EXIT_CODE\"."
exit $EXIT_CODE
fi
# test version
if [[ "$EXPECTED" == "$ACTUAL" ]]; then
echo "Passed with \"$ACTUAL\"."
exit 0
fi
echo 'Failed!'
echo "\"$EXPECTED\" != \"$ACTUAL\""
exit 1
## Instruction:
Support getting the commit hash without invoking git, for testing --full-version on a clean Linux install
## Code After:
set -eo pipefail
# The purpose of this test is to ensure that the output of the "nodeos --full-version" command matches the version string defined by our CMake files
echo '##### Nodeos Full Version Label Test #####'
# orient ourselves
[[ -z "$BUILD_ROOT" ]] && export BUILD_ROOT="$(pwd)"
echo "Using BUILD_ROOT=\"$BUILD_ROOT\"."
[[ -z "$CMAKE_SOURCE_DIR" ]] && export CMAKE_SOURCE_DIR="$2"
EXPECTED=$1
if [[ -z "$EXPECTED" ]]; then
echo "Missing version input."
exit 1
fi
[[ -z "$BUILDKITE_COMMIT" ]] && export BUILDKITE_COMMIT="$(pushd "$CMAKE_SOURCE_DIR" &>/dev/null && git rev-parse HEAD 2>/dev/null ; popd &>/dev/null)"
EXPECTED=v$EXPECTED-$BUILDKITE_COMMIT
echo "Expecting \"$EXPECTED\"..."
# get nodeos version
ACTUAL=$($BUILD_ROOT/bin/nodeos --full-version)
EXIT_CODE=$?
# verify 0 exit code explicitly
if [[ $EXIT_CODE -ne 0 ]]; then
echo "Nodeos produced non-zero exit code \"$EXIT_CODE\"."
exit $EXIT_CODE
fi
# test version
if [[ "$EXPECTED" == "$ACTUAL" ]]; then
echo "Passed with \"$ACTUAL\"."
exit 0
fi
echo 'Failed!'
echo "\"$EXPECTED\" != \"$ACTUAL\""
exit 1
| set -eo pipefail
# The purpose of this test is to ensure that the output of the "nodeos --full-version" command matches the version string defined by our CMake files
echo '##### Nodeos Full Version Label Test #####'
# orient ourselves
[[ -z "$BUILD_ROOT" ]] && export BUILD_ROOT="$(pwd)"
echo "Using BUILD_ROOT=\"$BUILD_ROOT\"."
[[ -z "$CMAKE_SOURCE_DIR" ]] && export CMAKE_SOURCE_DIR="$2"
EXPECTED=$1
if [[ -z "$EXPECTED" ]]; then
echo "Missing version input."
exit 1
fi
- VERSION_HASH="$(pushd "$CMAKE_SOURCE_DIR" &>/dev/null && git rev-parse HEAD 2>/dev/null ; popd &>/dev/null)"
? ^ ^^ ^^^^^^
+ [[ -z "$BUILDKITE_COMMIT" ]] && export BUILDKITE_COMMIT="$(pushd "$CMAKE_SOURCE_DIR" &>/dev/null && git rev-parse HEAD 2>/dev/null ; popd &>/dev/null)"
? ^^^^^^^^^^^^^^^^ ^^^^^ +++++++++++++++++++++++++++ ^^^^
- EXPECTED=v$EXPECTED-$VERSION_HASH
+ EXPECTED=v$EXPECTED-$BUILDKITE_COMMIT
echo "Expecting \"$EXPECTED\"..."
# get nodeos version
ACTUAL=$($BUILD_ROOT/bin/nodeos --full-version)
EXIT_CODE=$?
# verify 0 exit code explicitly
if [[ $EXIT_CODE -ne 0 ]]; then
echo "Nodeos produced non-zero exit code \"$EXIT_CODE\"."
exit $EXIT_CODE
fi
# test version
if [[ "$EXPECTED" == "$ACTUAL" ]]; then
echo "Passed with \"$ACTUAL\"."
exit 0
fi
echo 'Failed!'
echo "\"$EXPECTED\" != \"$ACTUAL\""
exit 1 | 4 | 0.129032 | 2 | 2 |
3db7a9e89ee1b2195437eed89b7f18ce43915f87 | src/nvim-go/nvim/command.go | src/nvim-go/nvim/command.go | package nvim
import (
"fmt"
"github.com/garyburd/neovim-go/vim"
)
func Echomsg(v *vim.Vim, format string, args ...interface{}) error {
return v.WriteOut(fmt.Sprintf(format, args...))
}
func Echoerr(v *vim.Vim, format string, args ...interface{}) error {
return v.WriteErr(fmt.Sprintf(format, args...))
}
| package nvim
import (
"fmt"
"github.com/garyburd/neovim-go/vim"
)
func Echo(v *vim.Vim, format string, a ...interface{}) error {
return v.Command("echo '" + fmt.Sprintf(format, a...) + "'")
}
func Echomsg(v *vim.Vim, format string, a ...interface{}) error {
return v.Command("echomsg '" + fmt.Sprintf(format, a...) + "'")
}
func Echoerr(v *vim.Vim, format string, a ...interface{}) error {
return v.Command("echoerr '" + fmt.Sprintf(format, a...) + "'")
}
func ReportError(v *vim.Vim, format string, a ...interface{}) error {
return v.ReportError(fmt.Sprintf(format, a...))
}
| Fix Echo*** and Add ReportError interface wrapper | Fix Echo*** and Add ReportError interface wrapper
Signed-off-by: Koichi Shiraishi <13fbd79c3d390e5d6585a21e11ff5ec1970cff0c@zchee.io>
| Go | bsd-3-clause | zchee/nvim-go,zchee/nvim-go | go | ## Code Before:
package nvim
import (
"fmt"
"github.com/garyburd/neovim-go/vim"
)
func Echomsg(v *vim.Vim, format string, args ...interface{}) error {
return v.WriteOut(fmt.Sprintf(format, args...))
}
func Echoerr(v *vim.Vim, format string, args ...interface{}) error {
return v.WriteErr(fmt.Sprintf(format, args...))
}
## Instruction:
Fix Echo*** and Add ReportError interface wrapper
Signed-off-by: Koichi Shiraishi <13fbd79c3d390e5d6585a21e11ff5ec1970cff0c@zchee.io>
## Code After:
package nvim
import (
"fmt"
"github.com/garyburd/neovim-go/vim"
)
func Echo(v *vim.Vim, format string, a ...interface{}) error {
return v.Command("echo '" + fmt.Sprintf(format, a...) + "'")
}
func Echomsg(v *vim.Vim, format string, a ...interface{}) error {
return v.Command("echomsg '" + fmt.Sprintf(format, a...) + "'")
}
func Echoerr(v *vim.Vim, format string, a ...interface{}) error {
return v.Command("echoerr '" + fmt.Sprintf(format, a...) + "'")
}
func ReportError(v *vim.Vim, format string, a ...interface{}) error {
return v.ReportError(fmt.Sprintf(format, a...))
}
| package nvim
import (
"fmt"
"github.com/garyburd/neovim-go/vim"
)
- func Echomsg(v *vim.Vim, format string, args ...interface{}) error {
? --- ---
+ func Echo(v *vim.Vim, format string, a ...interface{}) error {
- return v.WriteOut(fmt.Sprintf(format, args...))
+ return v.Command("echo '" + fmt.Sprintf(format, a...) + "'")
}
- func Echoerr(v *vim.Vim, format string, args ...interface{}) error {
? ^^^ ---
+ func Echomsg(v *vim.Vim, format string, a ...interface{}) error {
? ^^^
- return v.WriteErr(fmt.Sprintf(format, args...))
+ return v.Command("echomsg '" + fmt.Sprintf(format, a...) + "'")
}
+
+ func Echoerr(v *vim.Vim, format string, a ...interface{}) error {
+ return v.Command("echoerr '" + fmt.Sprintf(format, a...) + "'")
+ }
+
+ func ReportError(v *vim.Vim, format string, a ...interface{}) error {
+ return v.ReportError(fmt.Sprintf(format, a...))
+ } | 16 | 1.066667 | 12 | 4 |
502732496189be9c27708e74087e00e379ffe9ad | spec/retryable/configuration_spec.rb | spec/retryable/configuration_spec.rb | require 'spec_helper'
RSpec.describe Retryable do
it 'is enabled by default' do
expect(described_class).to be_enabled
end
it 'could be disabled' do
described_class.disable
expect(described_class).not_to be_enabled
end
context 'when disabled' do
before do
described_class.disable
end
it 'could be re-enabled' do
described_class.enable
expect(described_class).to be_enabled
end
end
context 'when configured globally with custom sleep parameter' do
it 'passes retry count and exception on retry' do
expect(Kernel).to receive(:sleep).once.with(3)
described_class.configure do |config|
config.sleep = 3
end
counter(tries: 2) do |tries, ex|
expect(ex.class).to eq(StandardError) if tries > 0
raise StandardError if tries < 1
end
expect(counter.count).to eq(2)
end
end
end
| require 'spec_helper'
RSpec.describe Retryable do
it 'is enabled by default' do
expect(described_class).to be_enabled
end
it 'could be disabled' do
described_class.disable
expect(described_class).not_to be_enabled
end
context 'when disabled' do
before do
described_class.disable
end
it 'could be re-enabled' do
described_class.enable
expect(described_class).to be_enabled
end
end
context 'when configured locally' do
it 'does not affect the original global config' do
new_sleep = 2
original_sleep = described_class.configuration.send(:sleep)
expect(original_sleep).not_to eq(new_sleep)
counter(tries: 2, sleep: new_sleep) do |tries, ex|
raise StandardError if tries < 1
end
actual = described_class.configuration.send(:sleep)
expect(actual).to eq(original_sleep)
end
end
context 'when configured globally with custom sleep parameter' do
it 'passes retry count and exception on retry' do
expect(Kernel).to receive(:sleep).once.with(3)
described_class.configure do |config|
config.sleep = 3
end
counter(tries: 2) do |tries, ex|
expect(ex.class).to eq(StandardError) if tries > 0
raise StandardError if tries < 1
end
expect(counter.count).to eq(2)
end
end
end
| Add regression spec for configuration | Add regression spec for configuration
| Ruby | mit | nfedyashev/retryable | ruby | ## Code Before:
require 'spec_helper'
RSpec.describe Retryable do
it 'is enabled by default' do
expect(described_class).to be_enabled
end
it 'could be disabled' do
described_class.disable
expect(described_class).not_to be_enabled
end
context 'when disabled' do
before do
described_class.disable
end
it 'could be re-enabled' do
described_class.enable
expect(described_class).to be_enabled
end
end
context 'when configured globally with custom sleep parameter' do
it 'passes retry count and exception on retry' do
expect(Kernel).to receive(:sleep).once.with(3)
described_class.configure do |config|
config.sleep = 3
end
counter(tries: 2) do |tries, ex|
expect(ex.class).to eq(StandardError) if tries > 0
raise StandardError if tries < 1
end
expect(counter.count).to eq(2)
end
end
end
## Instruction:
Add regression spec for configuration
## Code After:
require 'spec_helper'
RSpec.describe Retryable do
it 'is enabled by default' do
expect(described_class).to be_enabled
end
it 'could be disabled' do
described_class.disable
expect(described_class).not_to be_enabled
end
context 'when disabled' do
before do
described_class.disable
end
it 'could be re-enabled' do
described_class.enable
expect(described_class).to be_enabled
end
end
context 'when configured locally' do
it 'does not affect the original global config' do
new_sleep = 2
original_sleep = described_class.configuration.send(:sleep)
expect(original_sleep).not_to eq(new_sleep)
counter(tries: 2, sleep: new_sleep) do |tries, ex|
raise StandardError if tries < 1
end
actual = described_class.configuration.send(:sleep)
expect(actual).to eq(original_sleep)
end
end
context 'when configured globally with custom sleep parameter' do
it 'passes retry count and exception on retry' do
expect(Kernel).to receive(:sleep).once.with(3)
described_class.configure do |config|
config.sleep = 3
end
counter(tries: 2) do |tries, ex|
expect(ex.class).to eq(StandardError) if tries > 0
raise StandardError if tries < 1
end
expect(counter.count).to eq(2)
end
end
end
| require 'spec_helper'
RSpec.describe Retryable do
it 'is enabled by default' do
expect(described_class).to be_enabled
end
it 'could be disabled' do
described_class.disable
expect(described_class).not_to be_enabled
end
context 'when disabled' do
before do
described_class.disable
end
it 'could be re-enabled' do
described_class.enable
expect(described_class).to be_enabled
end
end
+ context 'when configured locally' do
+ it 'does not affect the original global config' do
+ new_sleep = 2
+ original_sleep = described_class.configuration.send(:sleep)
+
+ expect(original_sleep).not_to eq(new_sleep)
+
+ counter(tries: 2, sleep: new_sleep) do |tries, ex|
+ raise StandardError if tries < 1
+ end
+
+ actual = described_class.configuration.send(:sleep)
+ expect(actual).to eq(original_sleep)
+ end
+ end
+
context 'when configured globally with custom sleep parameter' do
it 'passes retry count and exception on retry' do
expect(Kernel).to receive(:sleep).once.with(3)
described_class.configure do |config|
config.sleep = 3
end
counter(tries: 2) do |tries, ex|
expect(ex.class).to eq(StandardError) if tries > 0
raise StandardError if tries < 1
end
expect(counter.count).to eq(2)
end
end
end | 16 | 0.410256 | 16 | 0 |
d7adcd3dc01a10e2a0a0504959058cb2155bf643 | .rubocop.yml | .rubocop.yml | Documentation:
Enabled: false
Style/Encoding:
Enabled: false
AllCops:
Include:
- '**/*.gemspec'
- '**/Rakefile'
| Documentation:
Enabled: false
Style/Encoding:
Enabled: false
Style/MultilineOperationIndentation:
Enabled: false
AllCops:
Include:
- '**/*.gemspec'
- '**/Rakefile'
| Disable Rubocop's multiline operation indentation | Disable Rubocop's multiline operation indentation
| YAML | mit | rranelli/git_multicast | yaml | ## Code Before:
Documentation:
Enabled: false
Style/Encoding:
Enabled: false
AllCops:
Include:
- '**/*.gemspec'
- '**/Rakefile'
## Instruction:
Disable Rubocop's multiline operation indentation
## Code After:
Documentation:
Enabled: false
Style/Encoding:
Enabled: false
Style/MultilineOperationIndentation:
Enabled: false
AllCops:
Include:
- '**/*.gemspec'
- '**/Rakefile'
| Documentation:
Enabled: false
Style/Encoding:
Enabled: false
+ Style/MultilineOperationIndentation:
+ Enabled: false
+
AllCops:
Include:
- '**/*.gemspec'
- '**/Rakefile' | 3 | 0.3 | 3 | 0 |
3f70b1b66d0521a4a0b8bfa3af9532e316add021 | restaurant/templates/registration/login.html | restaurant/templates/registration/login.html | <html>
<head>
<link rel="stylesheet" href="/static/css/login.css">
<head>
<body>
<div class="container">
{% block content %}
{% if login_errors %}
<p>Your username and password didn't match. Please try again.</p>
{% elif user_status %}
<p>Your account doesn't have access to this page. To proceed,
please login with an account that has access.</p>
{% endif %}
{% endblock %}
<h2>Login</h2>
<form method="post" id="login_form">
{% csrf_token %}
<div>
<label for="email">Email</label>
<input type="email" id="email" name="email">
</div>
<div>
<label for="password">Password</label>
<input type="password" id="email" name="password">
</div>
<div>
<input type="submit" value="Login">
</div>
</form>
<a href="{% url 'password_reset' %}" >Forgot password?</a>
</div>
</body>
</html>
| <html>
<head>
<link rel="stylesheet" href="/static/css/login.css">
<head>
<body>
<div class="container">
{% block content %}
{% if message %}
<p>{{ message }}</p>
{% endif %}
{% endblock %}
<h2>Login</h2>
<form method="post" id="login_form">
{% csrf_token %}
<div>
<label for="email">Email</label>
<input type="email" id="email" name="email">
</div>
<div>
<label for="password">Password</label>
<input type="password" id="email" name="password">
</div>
<div>
<input type="submit" value="Login">
</div>
</form>
<a href="{% url 'password_reset' %}" >Forgot password?</a>
</div>
</body>
</html>
| Change logic of error messages | Change logic of error messages
| HTML | mit | Social-projects-Rivne/Rv-025.Python,Social-projects-Rivne/Rv-025.Python,Social-projects-Rivne/Rv-025.Python | html | ## Code Before:
<html>
<head>
<link rel="stylesheet" href="/static/css/login.css">
<head>
<body>
<div class="container">
{% block content %}
{% if login_errors %}
<p>Your username and password didn't match. Please try again.</p>
{% elif user_status %}
<p>Your account doesn't have access to this page. To proceed,
please login with an account that has access.</p>
{% endif %}
{% endblock %}
<h2>Login</h2>
<form method="post" id="login_form">
{% csrf_token %}
<div>
<label for="email">Email</label>
<input type="email" id="email" name="email">
</div>
<div>
<label for="password">Password</label>
<input type="password" id="email" name="password">
</div>
<div>
<input type="submit" value="Login">
</div>
</form>
<a href="{% url 'password_reset' %}" >Forgot password?</a>
</div>
</body>
</html>
## Instruction:
Change logic of error messages
## Code After:
<html>
<head>
<link rel="stylesheet" href="/static/css/login.css">
<head>
<body>
<div class="container">
{% block content %}
{% if message %}
<p>{{ message }}</p>
{% endif %}
{% endblock %}
<h2>Login</h2>
<form method="post" id="login_form">
{% csrf_token %}
<div>
<label for="email">Email</label>
<input type="email" id="email" name="email">
</div>
<div>
<label for="password">Password</label>
<input type="password" id="email" name="password">
</div>
<div>
<input type="submit" value="Login">
</div>
</form>
<a href="{% url 'password_reset' %}" >Forgot password?</a>
</div>
</body>
</html>
| <html>
<head>
<link rel="stylesheet" href="/static/css/login.css">
<head>
<body>
<div class="container">
{% block content %}
+ {% if message %}
+ <p>{{ message }}</p>
+ {% endif %}
- {% if login_errors %}
- <p>Your username and password didn't match. Please try again.</p>
- {% elif user_status %}
- <p>Your account doesn't have access to this page. To proceed,
- please login with an account that has access.</p>
- {% endif %}
{% endblock %}
<h2>Login</h2>
<form method="post" id="login_form">
{% csrf_token %}
<div>
<label for="email">Email</label>
<input type="email" id="email" name="email">
</div>
<div>
<label for="password">Password</label>
<input type="password" id="email" name="password">
</div>
<div>
<input type="submit" value="Login">
</div>
</form>
<a href="{% url 'password_reset' %}" >Forgot password?</a>
</div>
</body>
</html>
| 9 | 0.25 | 3 | 6 |
86ac20c3793c2547bba3d8920a285c7b6d04d20a | bootstrap.php | bootstrap.php | <?php
/*
* This file is part of the French Extension for Flarum.
*
* (c) Maël Soucaze <maelsoucaze@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require __DIR__.'/vendor/autoload.php';
return 'Qia\Extension';
| <?php
use Flarum\Events\RegisterLocales;
use Illuminate\Events\Dispatcher;
return function (Dispatcher $events) {
$events->listen(RegisterLocales::class, function(RegisterLocales $event) {
$locale = $name = null;
if (file_exists($manifest = __DIR__.'/flarum.json')) {
$json = json_decode(file_get_contents($manifest), true);
$locale = array_key_exists('locale', $json) ? $json['locale'] : null;
$name = array_key_exists('name', $json) ? $json['name'] : null;
unset($json);
}
if ($name === null) {
throw new RuntimeException("Language pack ".__DIR__." needs a \"name\" in flarum.json.");
}
if ($locale === null) {
throw new RuntimeException("Language pack {$name} needs a \"locale\" in flarum.json.");
}
$event->addLocale($locale, $name);
if (! is_dir($localeDir = __DIR__.'/locale')) {
throw new RuntimeException("Language pack {$name} needs a \"locale\" subdirectory.");
}
if (file_exists($file = $localeDir.'/config.js')) {
$event->addJsFile($locale, $file);
}
if (file_exists($file = $localeDir.'/config.php')) {
$event->addConfig($locale, $file);
}
$files = new DirectoryIterator($localeDir);
foreach ($files as $file) {
if ($file->isFile() && in_array($file->getExtension(), ['yml', 'yaml'])) {
$event->addTranslations($locale, $file->getPathname());
}
}
});
};
| Use the new language extension skeleton. | Use the new language extension skeleton.
| PHP | mit | milescellar/flarum-ext-french,milescellar/flarum-ext-french,milescellar/flarum-ext-french | php | ## Code Before:
<?php
/*
* This file is part of the French Extension for Flarum.
*
* (c) Maël Soucaze <maelsoucaze@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require __DIR__.'/vendor/autoload.php';
return 'Qia\Extension';
## Instruction:
Use the new language extension skeleton.
## Code After:
<?php
use Flarum\Events\RegisterLocales;
use Illuminate\Events\Dispatcher;
return function (Dispatcher $events) {
$events->listen(RegisterLocales::class, function(RegisterLocales $event) {
$locale = $name = null;
if (file_exists($manifest = __DIR__.'/flarum.json')) {
$json = json_decode(file_get_contents($manifest), true);
$locale = array_key_exists('locale', $json) ? $json['locale'] : null;
$name = array_key_exists('name', $json) ? $json['name'] : null;
unset($json);
}
if ($name === null) {
throw new RuntimeException("Language pack ".__DIR__." needs a \"name\" in flarum.json.");
}
if ($locale === null) {
throw new RuntimeException("Language pack {$name} needs a \"locale\" in flarum.json.");
}
$event->addLocale($locale, $name);
if (! is_dir($localeDir = __DIR__.'/locale')) {
throw new RuntimeException("Language pack {$name} needs a \"locale\" subdirectory.");
}
if (file_exists($file = $localeDir.'/config.js')) {
$event->addJsFile($locale, $file);
}
if (file_exists($file = $localeDir.'/config.php')) {
$event->addConfig($locale, $file);
}
$files = new DirectoryIterator($localeDir);
foreach ($files as $file) {
if ($file->isFile() && in_array($file->getExtension(), ['yml', 'yaml'])) {
$event->addTranslations($locale, $file->getPathname());
}
}
});
};
| <?php
- /*
- * This file is part of the French Extension for Flarum.
- *
- * (c) Maël Soucaze <maelsoucaze@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
- require __DIR__.'/vendor/autoload.php';
+ use Flarum\Events\RegisterLocales;
+ use Illuminate\Events\Dispatcher;
- return 'Qia\Extension';
+ return function (Dispatcher $events) {
+ $events->listen(RegisterLocales::class, function(RegisterLocales $event) {
+ $locale = $name = null;
+
+ if (file_exists($manifest = __DIR__.'/flarum.json')) {
+ $json = json_decode(file_get_contents($manifest), true);
+ $locale = array_key_exists('locale', $json) ? $json['locale'] : null;
+ $name = array_key_exists('name', $json) ? $json['name'] : null;
+ unset($json);
+ }
+
+ if ($name === null) {
+ throw new RuntimeException("Language pack ".__DIR__." needs a \"name\" in flarum.json.");
+ }
+
+ if ($locale === null) {
+ throw new RuntimeException("Language pack {$name} needs a \"locale\" in flarum.json.");
+ }
+
+ $event->addLocale($locale, $name);
+
+ if (! is_dir($localeDir = __DIR__.'/locale')) {
+ throw new RuntimeException("Language pack {$name} needs a \"locale\" subdirectory.");
+ }
+
+ if (file_exists($file = $localeDir.'/config.js')) {
+ $event->addJsFile($locale, $file);
+ }
+
+ if (file_exists($file = $localeDir.'/config.php')) {
+ $event->addConfig($locale, $file);
+ }
+
+ $files = new DirectoryIterator($localeDir);
+
+ foreach ($files as $file) {
+ if ($file->isFile() && in_array($file->getExtension(), ['yml', 'yaml'])) {
+ $event->addTranslations($locale, $file->getPathname());
+ }
+ }
+ });
+ }; | 54 | 4.153846 | 44 | 10 |
873c215666688fcd62910ba661a5fcc125f2ed6d | etc/kube/start-minikube.sh | etc/kube/start-minikube.sh |
set -Eex
# Parse flags
VERSION=v1.13.0
minikube_args=(
--vm-driver=none
--kubernetes-version="${VERSION}"
)
while getopts ":v:r" opt; do
case "${opt}" in
v)
VERSION="v${OPTARG}"
;;
\?)
echo "Invalid argument: ${opt}"
exit 1
;;
esac
done
if [[ -n "${TRAVIS}" ]]; then
minikube_args+=("--bootstrapper=kubeadm")
fi
# Repeatedly restart minikube until it comes up. This corrects for an issue in
# Travis, where minikube will get stuck on startup and never recover
while true; do
sudo CHANGE_MINIKUBE_NONE_USER=true minikube start "${minikube_args[@]}"
HEALTHY=false
# Try to connect for one minute
for i in $(seq 12); do
if {
kubectl version 2>/dev/null >/dev/null && {
# Apply some manual changes to fix DNS.
kubectl -n kube-system describe sa/kube-dns ||
kubectl -n kube-system create sa kube-dns
}
}; then
HEALTHY=true
break
fi
sleep 5
done
if [ "${HEALTHY}" = "true" ]; then break; fi
# Give up--kubernetes isn't coming up
minikube delete
sleep 10 # Wait for minikube to go completely down
done
until kubectl -n kube-system patch deploy/kube-dns -p '{"spec": {"template": {"spec": {"serviceAccountName": "kube-dns"}}}}' 2>/dev/null >/dev/null; do sleep 5; done
|
set -Eex
# Parse flags
VERSION=v1.13.0
minikube_args=(
--vm-driver=none
--kubernetes-version="${VERSION}"
)
while getopts ":v:r" opt; do
case "${opt}" in
v)
VERSION="v${OPTARG}"
;;
\?)
echo "Invalid argument: ${opt}"
exit 1
;;
esac
done
if [[ -n "${TRAVIS}" ]]; then
minikube_args+=("--bootstrapper=kubeadm")
fi
# Repeatedly restart minikube until it comes up. This corrects for an issue in
# Travis, where minikube will get stuck on startup and never recover
while true; do
sudo CHANGE_MINIKUBE_NONE_USER=true minikube start "${minikube_args[@]}"
HEALTHY=false
# Try to connect for one minute
for i in $(seq 12); do
if {
kubectl version 2>/dev/null >/dev/null
}; then
HEALTHY=true
break
fi
sleep 5
done
if [ "${HEALTHY}" = "true" ]; then break; fi
# Give up--kubernetes isn't coming up
minikube delete
sleep 10 # Wait for minikube to go completely down
done
| Test if kube-dns issue has been resolved in newer version of minikube | Test if kube-dns issue has been resolved in newer version of minikube
| Shell | apache-2.0 | pachyderm/pfs,pachyderm/pfs,pachyderm/pfs | shell | ## Code Before:
set -Eex
# Parse flags
VERSION=v1.13.0
minikube_args=(
--vm-driver=none
--kubernetes-version="${VERSION}"
)
while getopts ":v:r" opt; do
case "${opt}" in
v)
VERSION="v${OPTARG}"
;;
\?)
echo "Invalid argument: ${opt}"
exit 1
;;
esac
done
if [[ -n "${TRAVIS}" ]]; then
minikube_args+=("--bootstrapper=kubeadm")
fi
# Repeatedly restart minikube until it comes up. This corrects for an issue in
# Travis, where minikube will get stuck on startup and never recover
while true; do
sudo CHANGE_MINIKUBE_NONE_USER=true minikube start "${minikube_args[@]}"
HEALTHY=false
# Try to connect for one minute
for i in $(seq 12); do
if {
kubectl version 2>/dev/null >/dev/null && {
# Apply some manual changes to fix DNS.
kubectl -n kube-system describe sa/kube-dns ||
kubectl -n kube-system create sa kube-dns
}
}; then
HEALTHY=true
break
fi
sleep 5
done
if [ "${HEALTHY}" = "true" ]; then break; fi
# Give up--kubernetes isn't coming up
minikube delete
sleep 10 # Wait for minikube to go completely down
done
until kubectl -n kube-system patch deploy/kube-dns -p '{"spec": {"template": {"spec": {"serviceAccountName": "kube-dns"}}}}' 2>/dev/null >/dev/null; do sleep 5; done
## Instruction:
Test if kube-dns issue has been resolved in newer version of minikube
## Code After:
set -Eex
# Parse flags
VERSION=v1.13.0
minikube_args=(
--vm-driver=none
--kubernetes-version="${VERSION}"
)
while getopts ":v:r" opt; do
case "${opt}" in
v)
VERSION="v${OPTARG}"
;;
\?)
echo "Invalid argument: ${opt}"
exit 1
;;
esac
done
if [[ -n "${TRAVIS}" ]]; then
minikube_args+=("--bootstrapper=kubeadm")
fi
# Repeatedly restart minikube until it comes up. This corrects for an issue in
# Travis, where minikube will get stuck on startup and never recover
while true; do
sudo CHANGE_MINIKUBE_NONE_USER=true minikube start "${minikube_args[@]}"
HEALTHY=false
# Try to connect for one minute
for i in $(seq 12); do
if {
kubectl version 2>/dev/null >/dev/null
}; then
HEALTHY=true
break
fi
sleep 5
done
if [ "${HEALTHY}" = "true" ]; then break; fi
# Give up--kubernetes isn't coming up
minikube delete
sleep 10 # Wait for minikube to go completely down
done
|
set -Eex
# Parse flags
VERSION=v1.13.0
minikube_args=(
--vm-driver=none
--kubernetes-version="${VERSION}"
)
while getopts ":v:r" opt; do
case "${opt}" in
v)
VERSION="v${OPTARG}"
;;
\?)
echo "Invalid argument: ${opt}"
exit 1
;;
esac
done
if [[ -n "${TRAVIS}" ]]; then
minikube_args+=("--bootstrapper=kubeadm")
fi
# Repeatedly restart minikube until it comes up. This corrects for an issue in
# Travis, where minikube will get stuck on startup and never recover
while true; do
sudo CHANGE_MINIKUBE_NONE_USER=true minikube start "${minikube_args[@]}"
HEALTHY=false
# Try to connect for one minute
for i in $(seq 12); do
if {
- kubectl version 2>/dev/null >/dev/null && {
? -----
+ kubectl version 2>/dev/null >/dev/null
- # Apply some manual changes to fix DNS.
- kubectl -n kube-system describe sa/kube-dns ||
- kubectl -n kube-system create sa kube-dns
- }
}; then
HEALTHY=true
break
fi
sleep 5
done
if [ "${HEALTHY}" = "true" ]; then break; fi
# Give up--kubernetes isn't coming up
minikube delete
sleep 10 # Wait for minikube to go completely down
done
-
- until kubectl -n kube-system patch deploy/kube-dns -p '{"spec": {"template": {"spec": {"serviceAccountName": "kube-dns"}}}}' 2>/dev/null >/dev/null; do sleep 5; done | 8 | 0.150943 | 1 | 7 |
c7d1c42961372adffc45b8536c5977e1a8f457d1 | environment.yml | environment.yml | name: bfd
dependencies:
# Testing Dependencies
- flake8
- pytest=2.8
# Run dependencies
- matplotlib=1.4
- notebook=4.0
- numpy=1.10
- pandas=0.17
- python=2.7
- scipy=0.16
- pip:
- concord-py==0.3
- yahoo-finance>=1.2
| name: bfd
dependencies:
# Testing Dependencies
- flake8
- pytest=2.8
# Run dependencies
- numpy=1.10
- pandas=0.17
- python=2.7
- scipy=0.16
- pip:
- concord-py==0.3
- yahoo-finance>=1.2
| Remove matplotlib and ipython dependencies | Remove matplotlib and ipython dependencies
| YAML | apache-2.0 | concord/bfd,AndrewAday/bfd,alanhdu/bfd,concord/ml | yaml | ## Code Before:
name: bfd
dependencies:
# Testing Dependencies
- flake8
- pytest=2.8
# Run dependencies
- matplotlib=1.4
- notebook=4.0
- numpy=1.10
- pandas=0.17
- python=2.7
- scipy=0.16
- pip:
- concord-py==0.3
- yahoo-finance>=1.2
## Instruction:
Remove matplotlib and ipython dependencies
## Code After:
name: bfd
dependencies:
# Testing Dependencies
- flake8
- pytest=2.8
# Run dependencies
- numpy=1.10
- pandas=0.17
- python=2.7
- scipy=0.16
- pip:
- concord-py==0.3
- yahoo-finance>=1.2
| name: bfd
dependencies:
# Testing Dependencies
- flake8
- pytest=2.8
# Run dependencies
- - matplotlib=1.4
- - notebook=4.0
- numpy=1.10
- pandas=0.17
- python=2.7
- scipy=0.16
- pip:
- concord-py==0.3
- yahoo-finance>=1.2 | 2 | 0.133333 | 0 | 2 |
6da289001eb3ffee9eb20c998fbfae74471a1a02 | app/Http/Controllers/Controller.php | app/Http/Controllers/Controller.php | <?php
namespace eHOSP\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Auth;
use App;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
public function __construct()
{
$this->middleware(function ($request, $next) {
if (Auth::user()) {
$country = Auth::user()->birth_country;
App::setLocale($country);
}
return $next($request);
});
}
}
| <?php
namespace eHOSP\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Auth;
use App;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
public function __construct()
{
$this->middleware(function ($request, $next) {
if (Auth::user()) {
$language = Auth::user()->language;
App::setLocale($language);
}
return $next($request);
});
}
}
| Set locale based on new language user table field | Set locale based on new language user table field
| PHP | apache-2.0 | ehosp/eHOSP-Services-CE,ehosp/eHOSP-Services-CE,ehosp/eHOSP-Services-CE | php | ## Code Before:
<?php
namespace eHOSP\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Auth;
use App;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
public function __construct()
{
$this->middleware(function ($request, $next) {
if (Auth::user()) {
$country = Auth::user()->birth_country;
App::setLocale($country);
}
return $next($request);
});
}
}
## Instruction:
Set locale based on new language user table field
## Code After:
<?php
namespace eHOSP\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Auth;
use App;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
public function __construct()
{
$this->middleware(function ($request, $next) {
if (Auth::user()) {
$language = Auth::user()->language;
App::setLocale($language);
}
return $next($request);
});
}
}
| <?php
namespace eHOSP\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Auth;
use App;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
public function __construct()
{
$this->middleware(function ($request, $next) {
if (Auth::user()) {
- $country = Auth::user()->birth_country;
+ $language = Auth::user()->language;
- App::setLocale($country);
? ^^ ^^^^
+ App::setLocale($language);
? ^^^^ ^^^
}
return $next($request);
});
}
} | 4 | 0.148148 | 2 | 2 |
325ca5357af3b3c769b9d80d5452aae41cc2ba4f | src/utils/versioning.py | src/utils/versioning.py | '''
Backup es index to S3 and refresh
'''
from tornado.ioloop import IOLoop
from web.api.es import ESQuery
async def backup_and_refresh():
'''
Run periodically in the main event loop
'''
def sync_func():
esq = ESQuery()
esq.backup_all(aws_s3_bucket='smartapi')
esq.refresh_all(dryrun=False)
await IOLoop.current().run_in_executor(None, sync_func)
| '''
Backup es index to S3 and refresh
'''
import logging
from tornado.ioloop import IOLoop
from web.api.es import ESQuery
async def backup_and_refresh():
'''
Run periodically in the main event loop
'''
def sync_func():
esq = ESQuery()
try:
esq.backup_all(aws_s3_bucket='smartapi')
except:
logging.exception("Backup failed.")
esq.refresh_all(dryrun=False)
await IOLoop.current().run_in_executor(None, sync_func)
| Make backup failures not disruptive | Make backup failures not disruptive
| Python | mit | Network-of-BioThings/smartAPI,Network-of-BioThings/smartAPI,Network-of-BioThings/smartAPI,Network-of-BioThings/smartAPI,Network-of-BioThings/smartAPI | python | ## Code Before:
'''
Backup es index to S3 and refresh
'''
from tornado.ioloop import IOLoop
from web.api.es import ESQuery
async def backup_and_refresh():
'''
Run periodically in the main event loop
'''
def sync_func():
esq = ESQuery()
esq.backup_all(aws_s3_bucket='smartapi')
esq.refresh_all(dryrun=False)
await IOLoop.current().run_in_executor(None, sync_func)
## Instruction:
Make backup failures not disruptive
## Code After:
'''
Backup es index to S3 and refresh
'''
import logging
from tornado.ioloop import IOLoop
from web.api.es import ESQuery
async def backup_and_refresh():
'''
Run periodically in the main event loop
'''
def sync_func():
esq = ESQuery()
try:
esq.backup_all(aws_s3_bucket='smartapi')
except:
logging.exception("Backup failed.")
esq.refresh_all(dryrun=False)
await IOLoop.current().run_in_executor(None, sync_func)
| '''
Backup es index to S3 and refresh
'''
+
+ import logging
from tornado.ioloop import IOLoop
from web.api.es import ESQuery
async def backup_and_refresh():
'''
Run periodically in the main event loop
'''
def sync_func():
esq = ESQuery()
+ try:
- esq.backup_all(aws_s3_bucket='smartapi')
+ esq.backup_all(aws_s3_bucket='smartapi')
? ++++
+ except:
+ logging.exception("Backup failed.")
esq.refresh_all(dryrun=False)
await IOLoop.current().run_in_executor(None, sync_func) | 7 | 0.368421 | 6 | 1 |
415ee6f03355363b015f1150fe885804f9ec830a | app/Services/Purchase.php | app/Services/Purchase.php | <?php namespace App\Services;
class Purchase
{
/**
*
* Purchase book function
*
* @param $book \App\Book
* @param $bookPurchaseQty integer
* @return array
*/
public function purchaseBook($book , $bookPurchaseQty)
{
$bookPrice = $book->price;
$bookAvailableQty = $book->quantity;
$response = [];
if($bookPurchaseQty > $bookAvailableQty) {
$response = ['message' => 'Book quantity not available' , 'data'=> ''];
}
return $response;
}
}
| <?php namespace App\Services;
class Purchase
{
/**
*
* Purchase book function
*
* @param $book \App\Book
* @param $bookPurchaseQty integer
* @return array
*/
public function purchaseBook($book , $bookPurchaseQty)
{
$bookPrice = $book->price;
$bookAvailableQty = $book->quantity;
$purchasePrice = null;
if($bookPurchaseQty > $bookAvailableQty) {
$purchasePrice = $bookPurchaseQty * $bookPrice;
}
return $purchasePrice;
}
}
| Add purchase functionality in back-end. | Add purchase functionality in back-end.
| PHP | mit | bitclaw/laravel-books-api,bitclaw/laravel-books-api,bitclaw/laravel-books-api | php | ## Code Before:
<?php namespace App\Services;
class Purchase
{
/**
*
* Purchase book function
*
* @param $book \App\Book
* @param $bookPurchaseQty integer
* @return array
*/
public function purchaseBook($book , $bookPurchaseQty)
{
$bookPrice = $book->price;
$bookAvailableQty = $book->quantity;
$response = [];
if($bookPurchaseQty > $bookAvailableQty) {
$response = ['message' => 'Book quantity not available' , 'data'=> ''];
}
return $response;
}
}
## Instruction:
Add purchase functionality in back-end.
## Code After:
<?php namespace App\Services;
class Purchase
{
/**
*
* Purchase book function
*
* @param $book \App\Book
* @param $bookPurchaseQty integer
* @return array
*/
public function purchaseBook($book , $bookPurchaseQty)
{
$bookPrice = $book->price;
$bookAvailableQty = $book->quantity;
$purchasePrice = null;
if($bookPurchaseQty > $bookAvailableQty) {
$purchasePrice = $bookPurchaseQty * $bookPrice;
}
return $purchasePrice;
}
}
| <?php namespace App\Services;
class Purchase
{
/**
*
* Purchase book function
*
* @param $book \App\Book
* @param $bookPurchaseQty integer
* @return array
*/
public function purchaseBook($book , $bookPurchaseQty)
{
$bookPrice = $book->price;
$bookAvailableQty = $book->quantity;
- $response = [];
+ $purchasePrice = null;
if($bookPurchaseQty > $bookAvailableQty) {
- $response = ['message' => 'Book quantity not available' , 'data'=> ''];
+ $purchasePrice = $bookPurchaseQty * $bookPrice;
}
- return $response;
+ return $purchasePrice;
}
} | 6 | 0.24 | 3 | 3 |
8a1c4594fefa720a6d1718551cca912c5bff00a0 | .travis.yml | .travis.yml | language: node_js
node_js:
- '4'
- '5'
- '6'
before_install:
- npm install -g bower gulp typings #firebase-tools
script:
- gulp build-dist
#after_success:
#- firebase deploy --token ${FIREBASE_TOKEN}
notifications:
email:
- jeevan@jeevanjames.com
webhooks: https://outlook.office365.com/webhook/6fa8f3c6-c8df-4aee-9ba7-c9bac0e22f1c@c6c1e9da-5d0c-4f8f-9a02-3c67206efbd6/TravisCI/a0bd584055a341229fa183fab269fe23/4e57288a-dffc-43b3-a2e0-1fafb92720c5
cache:
directories:
- .build/.dist
| language: node_js
node_js:
- '4'
- '5'
- '6'
before_install:
- npm install -g bower gulp typings #firebase-tools
script:
- gulp build-dist
#after_success:
#- firebase deploy --token ${FIREBASE_TOKEN}
notifications:
email:
- jeevan@jeevanjames.com
webhooks: https://outlook.office365.com/webhook/6fa8f3c6-c8df-4aee-9ba7-c9bac0e22f1c@c6c1e9da-5d0c-4f8f-9a02-3c67206efbd6/TravisCI/a0bd584055a341229fa183fab269fe23/4e57288a-dffc-43b3-a2e0-1fafb92720c5
addons:
artifacts:
s3_region: "mumbai"
| Remove CI cache and add artifact upload to S3 | Remove CI cache and add artifact upload to S3
| YAML | apache-2.0 | angular-template/ng1-template,angular-template/ng1-template,angular-template/ng1-template,angular-template/ng1-template | yaml | ## Code Before:
language: node_js
node_js:
- '4'
- '5'
- '6'
before_install:
- npm install -g bower gulp typings #firebase-tools
script:
- gulp build-dist
#after_success:
#- firebase deploy --token ${FIREBASE_TOKEN}
notifications:
email:
- jeevan@jeevanjames.com
webhooks: https://outlook.office365.com/webhook/6fa8f3c6-c8df-4aee-9ba7-c9bac0e22f1c@c6c1e9da-5d0c-4f8f-9a02-3c67206efbd6/TravisCI/a0bd584055a341229fa183fab269fe23/4e57288a-dffc-43b3-a2e0-1fafb92720c5
cache:
directories:
- .build/.dist
## Instruction:
Remove CI cache and add artifact upload to S3
## Code After:
language: node_js
node_js:
- '4'
- '5'
- '6'
before_install:
- npm install -g bower gulp typings #firebase-tools
script:
- gulp build-dist
#after_success:
#- firebase deploy --token ${FIREBASE_TOKEN}
notifications:
email:
- jeevan@jeevanjames.com
webhooks: https://outlook.office365.com/webhook/6fa8f3c6-c8df-4aee-9ba7-c9bac0e22f1c@c6c1e9da-5d0c-4f8f-9a02-3c67206efbd6/TravisCI/a0bd584055a341229fa183fab269fe23/4e57288a-dffc-43b3-a2e0-1fafb92720c5
addons:
artifacts:
s3_region: "mumbai"
| language: node_js
node_js:
- '4'
- '5'
- '6'
before_install:
- npm install -g bower gulp typings #firebase-tools
script:
- gulp build-dist
#after_success:
#- firebase deploy --token ${FIREBASE_TOKEN}
notifications:
email:
- jeevan@jeevanjames.com
webhooks: https://outlook.office365.com/webhook/6fa8f3c6-c8df-4aee-9ba7-c9bac0e22f1c@c6c1e9da-5d0c-4f8f-9a02-3c67206efbd6/TravisCI/a0bd584055a341229fa183fab269fe23/4e57288a-dffc-43b3-a2e0-1fafb92720c5
- cache:
- directories:
- - .build/.dist
+ addons:
+ artifacts:
+ s3_region: "mumbai"
+ | 7 | 0.304348 | 4 | 3 |
f273d6938e14e867850adcb60b48e9b20c696b61 | spec/controllers/notifications_controller_spec.rb | spec/controllers/notifications_controller_spec.rb |
require 'spec_helper'
describe NotificationsController do
let!(:user) { make_user }
let!(:aspect) { user.aspects.create(:name => "AWESOME!!") }
before do
sign_in :user, user
end
describe '#update' do
it 'marks a notification as read' do
note = Notification.create(:user_id => user.id)
put :update, :id => note.id
Notification.first.unread.should == false
end
it 'only lets you read your own notifications' do
user2 = make_user
Notification.create(:user_id => user.id)
note = Notification.create(:user_id => user2.id)
put :update, :id => note.id
Notification.find(note.id).unread.should == true
end
end
describe '#index' do
it 'paginates the notifications' do
35.times do
Notification.create(:user_id => user.id)
end
get :index
assigns[:notifications].should =~ Notification.all(:user_id => user.id, :limit => 25)
get :index, :page => 2
assigns[:notifications].should =~ Notification.all(:user_id => user.id, :offset => 25, :limit => 25)
end
end
end
|
require 'spec_helper'
describe NotificationsController do
let!(:user) { make_user }
let!(:aspect) { user.aspects.create(:name => "AWESOME!!") }
before do
sign_in :user, user
end
describe '#update' do
it 'marks a notification as read' do
note = Notification.create(:user_id => user.id)
put :update, :id => note.id
Notification.first.unread.should == false
end
it 'only lets you read your own notifications' do
user2 = make_user
Notification.create(:user_id => user.id)
note = Notification.create(:user_id => user2.id)
put :update, :id => note.id
Notification.find(note.id).unread.should == true
end
end
describe '#index' do
it 'paginates the notifications' do
35.times do
Notification.create(:user_id => user.id)
end
get :index
assigns[:notifications].count.should == 25
get :index, :page => 2
assigns[:notifications].count.should == 10
end
end
end
| Fix pagination spec - we don't care which 25 things are returned, just that 25 are returned. | Fix pagination spec - we don't care which 25 things are returned, just that 25 are returned.
| Ruby | agpl-3.0 | SuperTux88/diaspora,Muhannes/diaspora,jhass/diaspora,jhass/diaspora,Amadren/diaspora,Muhannes/diaspora,diaspora/diaspora,SuperTux88/diaspora,geraspora/diaspora,KentShikama/diaspora,Muhannes/diaspora,spixi/diaspora,geraspora/diaspora,spixi/diaspora,diaspora/diaspora,spixi/diaspora,geraspora/diaspora,jhass/diaspora,Amadren/diaspora,Flaburgan/diaspora,despora/diaspora,KentShikama/diaspora,Amadren/diaspora,SuperTux88/diaspora,Amadren/diaspora,diaspora/diaspora,jhass/diaspora,Flaburgan/diaspora,geraspora/diaspora,Muhannes/diaspora,despora/diaspora,Flaburgan/diaspora,spixi/diaspora,KentShikama/diaspora,KentShikama/diaspora,SuperTux88/diaspora,despora/diaspora,diaspora/diaspora,Flaburgan/diaspora,despora/diaspora | ruby | ## Code Before:
require 'spec_helper'
describe NotificationsController do
let!(:user) { make_user }
let!(:aspect) { user.aspects.create(:name => "AWESOME!!") }
before do
sign_in :user, user
end
describe '#update' do
it 'marks a notification as read' do
note = Notification.create(:user_id => user.id)
put :update, :id => note.id
Notification.first.unread.should == false
end
it 'only lets you read your own notifications' do
user2 = make_user
Notification.create(:user_id => user.id)
note = Notification.create(:user_id => user2.id)
put :update, :id => note.id
Notification.find(note.id).unread.should == true
end
end
describe '#index' do
it 'paginates the notifications' do
35.times do
Notification.create(:user_id => user.id)
end
get :index
assigns[:notifications].should =~ Notification.all(:user_id => user.id, :limit => 25)
get :index, :page => 2
assigns[:notifications].should =~ Notification.all(:user_id => user.id, :offset => 25, :limit => 25)
end
end
end
## Instruction:
Fix pagination spec - we don't care which 25 things are returned, just that 25 are returned.
## Code After:
require 'spec_helper'
describe NotificationsController do
let!(:user) { make_user }
let!(:aspect) { user.aspects.create(:name => "AWESOME!!") }
before do
sign_in :user, user
end
describe '#update' do
it 'marks a notification as read' do
note = Notification.create(:user_id => user.id)
put :update, :id => note.id
Notification.first.unread.should == false
end
it 'only lets you read your own notifications' do
user2 = make_user
Notification.create(:user_id => user.id)
note = Notification.create(:user_id => user2.id)
put :update, :id => note.id
Notification.find(note.id).unread.should == true
end
end
describe '#index' do
it 'paginates the notifications' do
35.times do
Notification.create(:user_id => user.id)
end
get :index
assigns[:notifications].count.should == 25
get :index, :page => 2
assigns[:notifications].count.should == 10
end
end
end
|
require 'spec_helper'
describe NotificationsController do
let!(:user) { make_user }
let!(:aspect) { user.aspects.create(:name => "AWESOME!!") }
before do
sign_in :user, user
-
end
describe '#update' do
it 'marks a notification as read' do
note = Notification.create(:user_id => user.id)
put :update, :id => note.id
Notification.first.unread.should == false
end
it 'only lets you read your own notifications' do
user2 = make_user
Notification.create(:user_id => user.id)
note = Notification.create(:user_id => user2.id)
put :update, :id => note.id
Notification.find(note.id).unread.should == true
end
end
describe '#index' do
it 'paginates the notifications' do
35.times do
Notification.create(:user_id => user.id)
end
get :index
- assigns[:notifications].should =~ Notification.all(:user_id => user.id, :limit => 25)
+ assigns[:notifications].count.should == 25
get :index, :page => 2
- assigns[:notifications].should =~ Notification.all(:user_id => user.id, :offset => 25, :limit => 25)
+ assigns[:notifications].count.should == 10
end
end
end | 5 | 0.108696 | 2 | 3 |
a84db04e56db56df6c19c2e5602101e6d9db675b | lib/document_number/numerator.rb | lib/document_number/numerator.rb | require "active_record/base"
module DocumentNumber
class Numerator
def self.next_number(object, options)
DocumentNumber.transaction do
if ::Rails.version < "4.0"
# Rails 3 support
document_number = DocumentNumber.lock(true).find_or_initialize_by_document(object.class.to_s.underscore)
else
document_number = DocumentNumber.lock(true).find_or_initialize_by(:document => object.class.to_s.underscore)
end
number = document_number.number == 1 ? options[:start] : document_number.number
document_number.number = number + 1
document_number.save!
number
end
end
end
end
| require "active_record/base"
module DocumentNumber
class Numerator
# Gets next number for document
def self.next_number(document, options)
DocumentNumber.transaction(requires_new: true) do
if ActiveRecord::VERSION::MAJOR < 4
document_number = DocumentNumber.lock(true).find_or_initialize_by_document(document)
else
document_number = DocumentNumber.lock(true).find_or_initialize_by(:document => document)
end
number = document_number.number == 1 ? options[:start] : document_number.number
document_number.number = number + 1
document_number.save!
number
end
end
end
end
| Check ActiveRecord version and use name | Check ActiveRecord version and use name
| Ruby | mit | 7Pikes/document_number,7Pikes/document_number,7Pikes/document_number | ruby | ## Code Before:
require "active_record/base"
module DocumentNumber
class Numerator
def self.next_number(object, options)
DocumentNumber.transaction do
if ::Rails.version < "4.0"
# Rails 3 support
document_number = DocumentNumber.lock(true).find_or_initialize_by_document(object.class.to_s.underscore)
else
document_number = DocumentNumber.lock(true).find_or_initialize_by(:document => object.class.to_s.underscore)
end
number = document_number.number == 1 ? options[:start] : document_number.number
document_number.number = number + 1
document_number.save!
number
end
end
end
end
## Instruction:
Check ActiveRecord version and use name
## Code After:
require "active_record/base"
module DocumentNumber
class Numerator
# Gets next number for document
def self.next_number(document, options)
DocumentNumber.transaction(requires_new: true) do
if ActiveRecord::VERSION::MAJOR < 4
document_number = DocumentNumber.lock(true).find_or_initialize_by_document(document)
else
document_number = DocumentNumber.lock(true).find_or_initialize_by(:document => document)
end
number = document_number.number == 1 ? options[:start] : document_number.number
document_number.number = number + 1
document_number.save!
number
end
end
end
end
| require "active_record/base"
module DocumentNumber
class Numerator
+ # Gets next number for document
- def self.next_number(object, options)
? ^^ ^
+ def self.next_number(document, options)
? + ^^^ ^
- DocumentNumber.transaction do
+ DocumentNumber.transaction(requires_new: true) do
? ++++++++++++++++++++
+ if ActiveRecord::VERSION::MAJOR < 4
- if ::Rails.version < "4.0"
- # Rails 3 support
- document_number = DocumentNumber.lock(true).find_or_initialize_by_document(object.class.to_s.underscore)
? ^^ ^ ----------------------
+ document_number = DocumentNumber.lock(true).find_or_initialize_by_document(document)
? + ^^^ ^
else
- document_number = DocumentNumber.lock(true).find_or_initialize_by(:document => object.class.to_s.underscore)
? ^^ ^ ----------------------
+ document_number = DocumentNumber.lock(true).find_or_initialize_by(:document => document)
? + ^^^ ^
end
number = document_number.number == 1 ? options[:start] : document_number.number
document_number.number = number + 1
document_number.save!
number
end
end
end
end | 12 | 0.521739 | 6 | 6 |
ec4b2fc266eb033dab9319c4d2f8ece6fd23170a | src/start_scraping.py | src/start_scraping.py | from main import initiate_shame
# Testing this
initiate_shame(1141922, 2016)
| from main import initiate_shame
initiate_shame(1141922, 2017)
initiate_shame(144768, 2017)
| Update script file for the season | Update script file for the season
| Python | mit | troym9731/fantasy_football | python | ## Code Before:
from main import initiate_shame
# Testing this
initiate_shame(1141922, 2016)
## Instruction:
Update script file for the season
## Code After:
from main import initiate_shame
initiate_shame(1141922, 2017)
initiate_shame(144768, 2017)
| from main import initiate_shame
- # Testing this
- initiate_shame(1141922, 2016)
? ^
+ initiate_shame(1141922, 2017)
? ^
+ initiate_shame(144768, 2017) | 4 | 1 | 2 | 2 |
b8ec493ab86b089269000a162904d6abe2af7d65 | README.rst | README.rst | What is it?
===========
This is a plausibly simple ZMTP/1.0 library.
That is, it provides the ability to speak enough ZMTP to send messages to a ZeroMQ peer, and, one day, to read messages back from it, and it does this as simply as possible (not no more simply).
This library does not attempt to provide the alleged functionality of the ZeroMQ libraries. It doesn't do threading or buffering, or even reconnection. It doesn't integrate with any cool IO frameworks, or do anything cool at all, really. It just writes a ZMTP stream to a java.io.OutputStream. Which you can get from a java.net.Socket.
How do i build it?
==================
With Gradle (http://www.gradle.org/). To build, simply do::
gradle clean build
This builds a jar file in ``build/libs``. To use this in other projects, you might like to install it in your local Maven repository::
gradle install
How do i use it?
================
Something like::
Socket socket = new Socket(host, port);
MessageOutputStream out = new MessageOutputStream(new FrameOutputStream(new BufferedOutputStream(socket.getOutputStream())));
out.write(message.getBytes());
out.flush();
| What is it?
===========
This is a plausibly simple ZMTP/1.0 library.
That is, it provides the ability to speak enough ZMTP to send messages to a ZeroMQ peer, and, one day, to read messages back from it, and it does this as simply as possible (not no more simply).
This library does not attempt to provide the alleged functionality of the ZeroMQ libraries. It doesn't do threading or buffering, or even reconnection. It doesn't integrate with any cool IO frameworks, or do anything cool at all, really. It just writes a ZMTP stream to a java.io.OutputStream. Which you can get from a java.net.Socket.
How do i build it?
==================
With Gradle (http://www.gradle.org/). To build, simply do::
gradle clean build
This builds a jar file in ``build/libs``. To use this in other projects, you might like to install it in your local Maven repository::
gradle install
How do i use it?
================
Something like::
Socket socket = new Socket(host, port);
MessageOutputStream out = new MessageOutputStream(new FrameOutputStream(new BufferedOutputStream(socket.getOutputStream())));
out.write(message.getBytes());
out.flush();
If you want automatic reconnection, do something like::
OutputStream sout = new ReconnectingSocketOutputStream(host, port, true);
MessageOutputStream out = new MessageOutputStream(new FrameOutputStream(new FullyBufferedOutputStream(sout)));
out.write(message.getBytes());
out.flush();
| Document the use of the automatic reconnection behaviour which might work | Document the use of the automatic reconnection behaviour which might work
| reStructuredText | bsd-2-clause | tim-group/simple-zmtp1 | restructuredtext | ## Code Before:
What is it?
===========
This is a plausibly simple ZMTP/1.0 library.
That is, it provides the ability to speak enough ZMTP to send messages to a ZeroMQ peer, and, one day, to read messages back from it, and it does this as simply as possible (not no more simply).
This library does not attempt to provide the alleged functionality of the ZeroMQ libraries. It doesn't do threading or buffering, or even reconnection. It doesn't integrate with any cool IO frameworks, or do anything cool at all, really. It just writes a ZMTP stream to a java.io.OutputStream. Which you can get from a java.net.Socket.
How do i build it?
==================
With Gradle (http://www.gradle.org/). To build, simply do::
gradle clean build
This builds a jar file in ``build/libs``. To use this in other projects, you might like to install it in your local Maven repository::
gradle install
How do i use it?
================
Something like::
Socket socket = new Socket(host, port);
MessageOutputStream out = new MessageOutputStream(new FrameOutputStream(new BufferedOutputStream(socket.getOutputStream())));
out.write(message.getBytes());
out.flush();
## Instruction:
Document the use of the automatic reconnection behaviour which might work
## Code After:
What is it?
===========
This is a plausibly simple ZMTP/1.0 library.
That is, it provides the ability to speak enough ZMTP to send messages to a ZeroMQ peer, and, one day, to read messages back from it, and it does this as simply as possible (not no more simply).
This library does not attempt to provide the alleged functionality of the ZeroMQ libraries. It doesn't do threading or buffering, or even reconnection. It doesn't integrate with any cool IO frameworks, or do anything cool at all, really. It just writes a ZMTP stream to a java.io.OutputStream. Which you can get from a java.net.Socket.
How do i build it?
==================
With Gradle (http://www.gradle.org/). To build, simply do::
gradle clean build
This builds a jar file in ``build/libs``. To use this in other projects, you might like to install it in your local Maven repository::
gradle install
How do i use it?
================
Something like::
Socket socket = new Socket(host, port);
MessageOutputStream out = new MessageOutputStream(new FrameOutputStream(new BufferedOutputStream(socket.getOutputStream())));
out.write(message.getBytes());
out.flush();
If you want automatic reconnection, do something like::
OutputStream sout = new ReconnectingSocketOutputStream(host, port, true);
MessageOutputStream out = new MessageOutputStream(new FrameOutputStream(new FullyBufferedOutputStream(sout)));
out.write(message.getBytes());
out.flush();
| What is it?
===========
This is a plausibly simple ZMTP/1.0 library.
That is, it provides the ability to speak enough ZMTP to send messages to a ZeroMQ peer, and, one day, to read messages back from it, and it does this as simply as possible (not no more simply).
This library does not attempt to provide the alleged functionality of the ZeroMQ libraries. It doesn't do threading or buffering, or even reconnection. It doesn't integrate with any cool IO frameworks, or do anything cool at all, really. It just writes a ZMTP stream to a java.io.OutputStream. Which you can get from a java.net.Socket.
How do i build it?
==================
With Gradle (http://www.gradle.org/). To build, simply do::
gradle clean build
This builds a jar file in ``build/libs``. To use this in other projects, you might like to install it in your local Maven repository::
gradle install
How do i use it?
================
Something like::
Socket socket = new Socket(host, port);
MessageOutputStream out = new MessageOutputStream(new FrameOutputStream(new BufferedOutputStream(socket.getOutputStream())));
out.write(message.getBytes());
out.flush();
+
+ If you want automatic reconnection, do something like::
+
+ OutputStream sout = new ReconnectingSocketOutputStream(host, port, true);
+ MessageOutputStream out = new MessageOutputStream(new FrameOutputStream(new FullyBufferedOutputStream(sout)));
+ out.write(message.getBytes());
+ out.flush(); | 7 | 0.241379 | 7 | 0 |
4dd488634aa030a8e9a1404e5fe026265dd07a75 | tailor/tests/utils/charformat_test.py | tailor/tests/utils/charformat_test.py | import unittest
from tailor.utils import charformat
class MyTestCase(unittest.TestCase):
def is_upper_camel_case_test_upper_camel_case_name(self):
self.assertTrue(charformat.is_upper_camel_case('HelloWorld'))
def is_upper_camel_case_test_lower_camel_case_name(self):
self.assertFalse(charformat.is_upper_camel_case('helloWorld'))
def is_upper_camel_case_test_blank_name(self):
self.assertFalse(charformat.is_upper_camel_case(''))
def is_upper_camel_case_test_snake_case_name(self):
self.assertFalse(charformat.is_upper_camel_case('Hello_World'))
if __name__ == '__main__':
unittest.main()
| import unittest
from tailor.utils import charformat
class MyTestCase(unittest.TestCase):
def is_upper_camel_case_test_upper_camel_case_name(self):
self.assertTrue(charformat.is_upper_camel_case('HelloWorld'))
def is_upper_camel_case_test_lower_camel_case_name(self):
self.assertFalse(charformat.is_upper_camel_case('helloWorld'))
def is_upper_camel_case_test_blank_name(self):
self.assertFalse(charformat.is_upper_camel_case(''))
def is_upper_camel_case_test_snake_case_name(self):
self.assertFalse(charformat.is_upper_camel_case('Hello_World'))
def is_upper_camel_case_test_numeric_name(self):
self.assertFalse(charformat.is_upper_camel_case('1ello_world'))
if __name__ == '__main__':
unittest.main()
| Add numeric name test case | Add numeric name test case
| Python | mit | sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor | python | ## Code Before:
import unittest
from tailor.utils import charformat
class MyTestCase(unittest.TestCase):
def is_upper_camel_case_test_upper_camel_case_name(self):
self.assertTrue(charformat.is_upper_camel_case('HelloWorld'))
def is_upper_camel_case_test_lower_camel_case_name(self):
self.assertFalse(charformat.is_upper_camel_case('helloWorld'))
def is_upper_camel_case_test_blank_name(self):
self.assertFalse(charformat.is_upper_camel_case(''))
def is_upper_camel_case_test_snake_case_name(self):
self.assertFalse(charformat.is_upper_camel_case('Hello_World'))
if __name__ == '__main__':
unittest.main()
## Instruction:
Add numeric name test case
## Code After:
import unittest
from tailor.utils import charformat
class MyTestCase(unittest.TestCase):
def is_upper_camel_case_test_upper_camel_case_name(self):
self.assertTrue(charformat.is_upper_camel_case('HelloWorld'))
def is_upper_camel_case_test_lower_camel_case_name(self):
self.assertFalse(charformat.is_upper_camel_case('helloWorld'))
def is_upper_camel_case_test_blank_name(self):
self.assertFalse(charformat.is_upper_camel_case(''))
def is_upper_camel_case_test_snake_case_name(self):
self.assertFalse(charformat.is_upper_camel_case('Hello_World'))
def is_upper_camel_case_test_numeric_name(self):
self.assertFalse(charformat.is_upper_camel_case('1ello_world'))
if __name__ == '__main__':
unittest.main()
| import unittest
from tailor.utils import charformat
class MyTestCase(unittest.TestCase):
def is_upper_camel_case_test_upper_camel_case_name(self):
self.assertTrue(charformat.is_upper_camel_case('HelloWorld'))
def is_upper_camel_case_test_lower_camel_case_name(self):
self.assertFalse(charformat.is_upper_camel_case('helloWorld'))
def is_upper_camel_case_test_blank_name(self):
self.assertFalse(charformat.is_upper_camel_case(''))
def is_upper_camel_case_test_snake_case_name(self):
self.assertFalse(charformat.is_upper_camel_case('Hello_World'))
+ def is_upper_camel_case_test_numeric_name(self):
+ self.assertFalse(charformat.is_upper_camel_case('1ello_world'))
if __name__ == '__main__':
unittest.main() | 2 | 0.095238 | 2 | 0 |
2d4b3767c2bf6b60089f8b575e676d9500749278 | recipes/r-rubic/meta.yaml | recipes/r-rubic/meta.yaml | package:
name: r-rubic
version: 1.0.2
source:
url: https://github.com/NKI-CCB/RUBIC/archive/v1.0.2.tar.gz
sha256: cb24478b58c8b5800da4a1d8594c19a8eec56ef51efd92e7e14ce3b0dbb6141e
build:
number: 0
rpaths:
- lib/R/lib/
- lib/
requirements:
build:
- r
- 'r-data.table >1.9.6'
- 'r-digest'
- 'r-ggplot2'
- 'r-pracma'
- 'r-gtable'
run:
- r
- 'r-data.table >1.9.6'
- 'r-digest'
- 'r-ggplot2'
- 'r-pracma'
- 'r-gtable'
test:
commands:
- '$R -e "library(''RUBIC'')"'
about:
home: http://ccb.nki.nl/software/
license: Apache-2.0
summary: 'RUBIC detects recurrent copy number aberrations using copy number
breaks, rather than recurrently amplified or deleted regions. This allows
for a vastly simplified approach as recursive peak splitting procedures and
repeated re-estimation of the background model are avoided. Furthermore,
the false discovery rate is controlled on the level of called regions,
rather than at the probe level.'
| package:
name: r-rubic
version: 1.0.2
source:
url: https://github.com/NKI-CCB/RUBIC/archive/v1.0.2.tar.gz
sha256: cb24478b58c8b5800da4a1d8594c19a8eec56ef51efd92e7e14ce3b0dbb6141e
build:
number: 0
rpaths:
- lib/R/lib/
- lib/
requirements:
build:
- r-base
- 'r-data.table >1.9.6'
- 'r-digest'
- 'r-ggplot2'
- 'r-pracma'
- 'r-gtable'
run:
- r-base
- 'r-data.table >1.9.6'
- 'r-digest'
- 'r-ggplot2'
- 'r-pracma'
- 'r-gtable'
test:
commands:
- '$R -e "library(''RUBIC'')"'
about:
home: http://ccb.nki.nl/software/
license: Apache-2.0
summary: 'RUBIC detects recurrent copy number aberrations using copy number
breaks, rather than recurrently amplified or deleted regions. This allows
for a vastly simplified approach as recursive peak splitting procedures and
repeated re-estimation of the background model are avoided. Furthermore,
the false discovery rate is controlled on the level of called regions,
rather than at the probe level.'
| Use r-base instead of r | Use r-base instead of r | YAML | mit | xguse/bioconda-recipes,abims-sbr/bioconda-recipes,abims-sbr/bioconda-recipes,jasper1918/bioconda-recipes,mdehollander/bioconda-recipes,colinbrislawn/bioconda-recipes,peterjc/bioconda-recipes,shenwei356/bioconda-recipes,HassanAmr/bioconda-recipes,saketkc/bioconda-recipes,gvlproject/bioconda-recipes,martin-mann/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,joachimwolff/bioconda-recipes,matthdsm/bioconda-recipes,roryk/recipes,phac-nml/bioconda-recipes,peterjc/bioconda-recipes,gvlproject/bioconda-recipes,dkoppstein/recipes,gvlproject/bioconda-recipes,bebatut/bioconda-recipes,hardingnj/bioconda-recipes,keuv-grvl/bioconda-recipes,cokelaer/bioconda-recipes,CGATOxford/bioconda-recipes,daler/bioconda-recipes,CGATOxford/bioconda-recipes,saketkc/bioconda-recipes,lpantano/recipes,bebatut/bioconda-recipes,HassanAmr/bioconda-recipes,ostrokach/bioconda-recipes,chapmanb/bioconda-recipes,roryk/recipes,npavlovikj/bioconda-recipes,mcornwell1957/bioconda-recipes,oena/bioconda-recipes,Luobiny/bioconda-recipes,joachimwolff/bioconda-recipes,cokelaer/bioconda-recipes,saketkc/bioconda-recipes,rvalieris/bioconda-recipes,abims-sbr/bioconda-recipes,joachimwolff/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,mdehollander/bioconda-recipes,oena/bioconda-recipes,instituteofpathologyheidelberg/bioconda-recipes,blankenberg/bioconda-recipes,peterjc/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,instituteofpathologyheidelberg/bioconda-recipes,ivirshup/bioconda-recipes,CGATOxford/bioconda-recipes,daler/bioconda-recipes,ivirshup/bioconda-recipes,dmaticzka/bioconda-recipes,dkoppstein/recipes,hardingnj/bioconda-recipes,jasper1918/bioconda-recipes,blankenberg/bioconda-recipes,mdehollander/bioconda-recipes,xguse/bioconda-recipes,joachimwolff/bioconda-recipes,jasper1918/bioconda-recipes,bioconda/bioconda-recipes,HassanAmr/bioconda-recipes,gvlproject/bioconda-recipes,bow/bioconda-recipes,ostrokach/bioconda-recipes,abims-sbr/bioconda-recipes,acaprez/recipes,martin-mann/bioconda-recipes,acaprez/recipes,shenwei356/bioconda-recipes,hardingnj/bioconda-recipes,cokelaer/bioconda-recipes,colinbrislawn/bioconda-recipes,gregvonkuster/bioconda-recipes,npavlovikj/bioconda-recipes,shenwei356/bioconda-recipes,acaprez/recipes,bow/bioconda-recipes,lpantano/recipes,matthdsm/bioconda-recipes,phac-nml/bioconda-recipes,instituteofpathologyheidelberg/bioconda-recipes,bioconda/bioconda-recipes,rvalieris/bioconda-recipes,saketkc/bioconda-recipes,Luobiny/bioconda-recipes,roryk/recipes,chapmanb/bioconda-recipes,rob-p/bioconda-recipes,dmaticzka/bioconda-recipes,rvalieris/bioconda-recipes,rvalieris/bioconda-recipes,saketkc/bioconda-recipes,bow/bioconda-recipes,mcornwell1957/bioconda-recipes,bow/bioconda-recipes,Luobiny/bioconda-recipes,cokelaer/bioconda-recipes,rob-p/bioconda-recipes,omicsnut/bioconda-recipes,acaprez/recipes,omicsnut/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,keuv-grvl/bioconda-recipes,martin-mann/bioconda-recipes,CGATOxford/bioconda-recipes,matthdsm/bioconda-recipes,phac-nml/bioconda-recipes,gregvonkuster/bioconda-recipes,rvalieris/bioconda-recipes,bioconda/recipes,dmaticzka/bioconda-recipes,zachcp/bioconda-recipes,oena/bioconda-recipes,martin-mann/bioconda-recipes,gvlproject/bioconda-recipes,mdehollander/bioconda-recipes,ivirshup/bioconda-recipes,mdehollander/bioconda-recipes,rvalieris/bioconda-recipes,ivirshup/bioconda-recipes,jfallmann/bioconda-recipes,HassanAmr/bioconda-recipes,rob-p/bioconda-recipes,bow/bioconda-recipes,ivirshup/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,omicsnut/bioconda-recipes,bebatut/bioconda-recipes,daler/bioconda-recipes,Luobiny/bioconda-recipes,hardingnj/bioconda-recipes,dmaticzka/bioconda-recipes,hardingnj/bioconda-recipes,omicsnut/bioconda-recipes,dkoppstein/recipes,bioconda/bioconda-recipes,daler/bioconda-recipes,HassanAmr/bioconda-recipes,phac-nml/bioconda-recipes,instituteofpathologyheidelberg/bioconda-recipes,phac-nml/bioconda-recipes,dmaticzka/bioconda-recipes,matthdsm/bioconda-recipes,daler/bioconda-recipes,jasper1918/bioconda-recipes,peterjc/bioconda-recipes,CGATOxford/bioconda-recipes,zachcp/bioconda-recipes,npavlovikj/bioconda-recipes,matthdsm/bioconda-recipes,bioconda/bioconda-recipes,colinbrislawn/bioconda-recipes,mcornwell1957/bioconda-recipes,matthdsm/bioconda-recipes,blankenberg/bioconda-recipes,xguse/bioconda-recipes,oena/bioconda-recipes,colinbrislawn/bioconda-recipes,keuv-grvl/bioconda-recipes,lpantano/recipes,omicsnut/bioconda-recipes,colinbrislawn/bioconda-recipes,xguse/bioconda-recipes,mcornwell1957/bioconda-recipes,npavlovikj/bioconda-recipes,dmaticzka/bioconda-recipes,shenwei356/bioconda-recipes,chapmanb/bioconda-recipes,zachcp/bioconda-recipes,peterjc/bioconda-recipes,joachimwolff/bioconda-recipes,abims-sbr/bioconda-recipes,ostrokach/bioconda-recipes,jfallmann/bioconda-recipes,bioconda/recipes,gregvonkuster/bioconda-recipes,gregvonkuster/bioconda-recipes,martin-mann/bioconda-recipes,HassanAmr/bioconda-recipes,CGATOxford/bioconda-recipes,ostrokach/bioconda-recipes,jfallmann/bioconda-recipes,ivirshup/bioconda-recipes,chapmanb/bioconda-recipes,daler/bioconda-recipes,keuv-grvl/bioconda-recipes,blankenberg/bioconda-recipes,rob-p/bioconda-recipes,jfallmann/bioconda-recipes,lpantano/recipes,xguse/bioconda-recipes,peterjc/bioconda-recipes,joachimwolff/bioconda-recipes,instituteofpathologyheidelberg/bioconda-recipes,mcornwell1957/bioconda-recipes,jasper1918/bioconda-recipes,colinbrislawn/bioconda-recipes,ostrokach/bioconda-recipes,keuv-grvl/bioconda-recipes,abims-sbr/bioconda-recipes,chapmanb/bioconda-recipes,ostrokach/bioconda-recipes,keuv-grvl/bioconda-recipes,zachcp/bioconda-recipes,mdehollander/bioconda-recipes,bebatut/bioconda-recipes,bioconda/recipes,oena/bioconda-recipes,saketkc/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,bow/bioconda-recipes,gvlproject/bioconda-recipes | yaml | ## Code Before:
package:
name: r-rubic
version: 1.0.2
source:
url: https://github.com/NKI-CCB/RUBIC/archive/v1.0.2.tar.gz
sha256: cb24478b58c8b5800da4a1d8594c19a8eec56ef51efd92e7e14ce3b0dbb6141e
build:
number: 0
rpaths:
- lib/R/lib/
- lib/
requirements:
build:
- r
- 'r-data.table >1.9.6'
- 'r-digest'
- 'r-ggplot2'
- 'r-pracma'
- 'r-gtable'
run:
- r
- 'r-data.table >1.9.6'
- 'r-digest'
- 'r-ggplot2'
- 'r-pracma'
- 'r-gtable'
test:
commands:
- '$R -e "library(''RUBIC'')"'
about:
home: http://ccb.nki.nl/software/
license: Apache-2.0
summary: 'RUBIC detects recurrent copy number aberrations using copy number
breaks, rather than recurrently amplified or deleted regions. This allows
for a vastly simplified approach as recursive peak splitting procedures and
repeated re-estimation of the background model are avoided. Furthermore,
the false discovery rate is controlled on the level of called regions,
rather than at the probe level.'
## Instruction:
Use r-base instead of r
## Code After:
package:
name: r-rubic
version: 1.0.2
source:
url: https://github.com/NKI-CCB/RUBIC/archive/v1.0.2.tar.gz
sha256: cb24478b58c8b5800da4a1d8594c19a8eec56ef51efd92e7e14ce3b0dbb6141e
build:
number: 0
rpaths:
- lib/R/lib/
- lib/
requirements:
build:
- r-base
- 'r-data.table >1.9.6'
- 'r-digest'
- 'r-ggplot2'
- 'r-pracma'
- 'r-gtable'
run:
- r-base
- 'r-data.table >1.9.6'
- 'r-digest'
- 'r-ggplot2'
- 'r-pracma'
- 'r-gtable'
test:
commands:
- '$R -e "library(''RUBIC'')"'
about:
home: http://ccb.nki.nl/software/
license: Apache-2.0
summary: 'RUBIC detects recurrent copy number aberrations using copy number
breaks, rather than recurrently amplified or deleted regions. This allows
for a vastly simplified approach as recursive peak splitting procedures and
repeated re-estimation of the background model are avoided. Furthermore,
the false discovery rate is controlled on the level of called regions,
rather than at the probe level.'
| package:
name: r-rubic
version: 1.0.2
source:
url: https://github.com/NKI-CCB/RUBIC/archive/v1.0.2.tar.gz
sha256: cb24478b58c8b5800da4a1d8594c19a8eec56ef51efd92e7e14ce3b0dbb6141e
build:
number: 0
rpaths:
- lib/R/lib/
- lib/
requirements:
build:
- - r
+ - r-base
- 'r-data.table >1.9.6'
- 'r-digest'
- 'r-ggplot2'
- 'r-pracma'
- 'r-gtable'
run:
- - r
+ - r-base
- 'r-data.table >1.9.6'
- 'r-digest'
- 'r-ggplot2'
- 'r-pracma'
- 'r-gtable'
test:
commands:
- '$R -e "library(''RUBIC'')"'
about:
home: http://ccb.nki.nl/software/
license: Apache-2.0
summary: 'RUBIC detects recurrent copy number aberrations using copy number
breaks, rather than recurrently amplified or deleted regions. This allows
for a vastly simplified approach as recursive peak splitting procedures and
repeated re-estimation of the background model are avoided. Furthermore,
the false discovery rate is controlled on the level of called regions,
rather than at the probe level.' | 4 | 0.105263 | 2 | 2 |
edc4f5b84f1d8a59bcde69e5b33a07deb124b1a7 | web/IFrame.qml | web/IFrame.qml | /// iframe item to embed other page
Item {
property string source; ///< another page source URL
///@private
function getTag() { return 'iframe' }
onSourceChanged: { this.element.dom.src = value; }
}
| /// iframe item to embed other page
Item {
signal loaded; ///< page was loaded signal
property string source; ///< another page source URL
///@private
function getTag() { return 'iframe' }
onSourceChanged: { this.element.dom.src = value; }
constructor: {
var self = this
this.element.dom.onload = function() { self.source = this.src; self.loaded() }
}
}
| Update 'source' property if iframe was reloaded + add 'loaded' signal | Update 'source' property if iframe was reloaded + add 'loaded' signal
| QML | mit | pureqml/controls | qml | ## Code Before:
/// iframe item to embed other page
Item {
property string source; ///< another page source URL
///@private
function getTag() { return 'iframe' }
onSourceChanged: { this.element.dom.src = value; }
}
## Instruction:
Update 'source' property if iframe was reloaded + add 'loaded' signal
## Code After:
/// iframe item to embed other page
Item {
signal loaded; ///< page was loaded signal
property string source; ///< another page source URL
///@private
function getTag() { return 'iframe' }
onSourceChanged: { this.element.dom.src = value; }
constructor: {
var self = this
this.element.dom.onload = function() { self.source = this.src; self.loaded() }
}
}
| /// iframe item to embed other page
Item {
+ signal loaded; ///< page was loaded signal
property string source; ///< another page source URL
///@private
function getTag() { return 'iframe' }
onSourceChanged: { this.element.dom.src = value; }
+
+ constructor: {
+ var self = this
+ this.element.dom.onload = function() { self.source = this.src; self.loaded() }
+ }
} | 6 | 0.666667 | 6 | 0 |
8977e0e24e6b396c2379e8f714f232c180c0cedb | app/assets/javascripts/mixins/views/redirects_on_editable.js.coffee | app/assets/javascripts/mixins/views/redirects_on_editable.js.coffee | ETahi.RedirectsIfEditable = Em.Mixin.create
toggleEditable: ->
@get('controller').send('editableDidChange')
setupEditableToggle: (->
@addObserver('controller.model.editable', @, @toggleEditable)
).on('didInsertElement')
teardownEditableToggle: (->
@removeObserver('controller.model.editable', @, @toggleEditable)
).on('willDestroyElement')
| ETahi.RedirectsIfEditable = Em.Mixin.create
editable: Ember.computed.alias('controller.model.editable')
toggleEditable: ->
if @get('editable') != @get('lastEditable')
@set('lastEditable', @get('editable'))
@get('controller').send('editableDidChange')
setupEditableToggle: (->
@set('lastEditable', @get('editable'))
@addObserver('editable', @, @toggleEditable)
).on('didInsertElement')
teardownEditableToggle: (->
@removeObserver('editable', @, @toggleEditable)
).on('willDestroyElement')
| Fix transitions when editable isn’t actually changing | Fix transitions when editable isn’t actually changing | CoffeeScript | mit | johan--/tahi,johan--/tahi,johan--/tahi,johan--/tahi | coffeescript | ## Code Before:
ETahi.RedirectsIfEditable = Em.Mixin.create
toggleEditable: ->
@get('controller').send('editableDidChange')
setupEditableToggle: (->
@addObserver('controller.model.editable', @, @toggleEditable)
).on('didInsertElement')
teardownEditableToggle: (->
@removeObserver('controller.model.editable', @, @toggleEditable)
).on('willDestroyElement')
## Instruction:
Fix transitions when editable isn’t actually changing
## Code After:
ETahi.RedirectsIfEditable = Em.Mixin.create
editable: Ember.computed.alias('controller.model.editable')
toggleEditable: ->
if @get('editable') != @get('lastEditable')
@set('lastEditable', @get('editable'))
@get('controller').send('editableDidChange')
setupEditableToggle: (->
@set('lastEditable', @get('editable'))
@addObserver('editable', @, @toggleEditable)
).on('didInsertElement')
teardownEditableToggle: (->
@removeObserver('editable', @, @toggleEditable)
).on('willDestroyElement')
| ETahi.RedirectsIfEditable = Em.Mixin.create
+ editable: Ember.computed.alias('controller.model.editable')
+
toggleEditable: ->
+ if @get('editable') != @get('lastEditable')
+ @set('lastEditable', @get('editable'))
- @get('controller').send('editableDidChange')
+ @get('controller').send('editableDidChange')
? ++
setupEditableToggle: (->
+ @set('lastEditable', @get('editable'))
- @addObserver('controller.model.editable', @, @toggleEditable)
? -----------------
+ @addObserver('editable', @, @toggleEditable)
).on('didInsertElement')
teardownEditableToggle: (->
- @removeObserver('controller.model.editable', @, @toggleEditable)
? -----------------
+ @removeObserver('editable', @, @toggleEditable)
).on('willDestroyElement') | 11 | 1 | 8 | 3 |
66349769feb97127586389be6fa5e070e28fe38b | README.md | README.md |
Validate Swedish social security numbers.
Install the module with npm:
```
$ npm install is-personnummer
```
or with Bower, with AMD and browser support:
```
$ bower install is-personnummer
```
or as cli:
```
$ npm install -g is-personnummer
$ is-personnummer 510818-9167
$ true
```
## Example
```javascript
$ node
> var isPersonnummer = require('is-personnummer');
undefined
> isPersonnummer('510818-9167');
true
> isPersonnummer('19130401+2931')
true
> isPersonnummer('196408233234')
true
> isPersonnummer('510818-916')
false
> isPersonnummer('19130401+293')
false
> isPersonnummer('19640823323')
false
```
See [test.js](test.js) for more examples.
## License
MIT © [Fredrik Forsmo](https://github.com/frozzare)
|
Validate Swedish social security numbers.
Install the module with npm:
```
$ npm install is-personnummer
```
or with Bower, with AMD and browser support:
```
$ bower install is-personnummer
```
or as cli:
```
$ npm install -g is-personnummer
$ is-personnummer 510818-9167
$ true
```
## Example
```javascript
$ node
> var isPersonnummer = require('is-personnummer');
undefined
> isPersonnummer('510818-9167');
true
> isPersonnummer('19130401+2931')
true
> isPersonnummer('196408233234')
true
> isPersonnummer('510818-916')
false
> isPersonnummer('19130401+293')
false
> isPersonnummer('19640823323')
false
```
See [test.js](test.js) for more examples.
## License
MIT
| Remove my name from license readme | Remove my name from license readme | Markdown | mit | personnummer/js,frozzare/is-personnummer,personnummer/js | markdown | ## Code Before:
Validate Swedish social security numbers.
Install the module with npm:
```
$ npm install is-personnummer
```
or with Bower, with AMD and browser support:
```
$ bower install is-personnummer
```
or as cli:
```
$ npm install -g is-personnummer
$ is-personnummer 510818-9167
$ true
```
## Example
```javascript
$ node
> var isPersonnummer = require('is-personnummer');
undefined
> isPersonnummer('510818-9167');
true
> isPersonnummer('19130401+2931')
true
> isPersonnummer('196408233234')
true
> isPersonnummer('510818-916')
false
> isPersonnummer('19130401+293')
false
> isPersonnummer('19640823323')
false
```
See [test.js](test.js) for more examples.
## License
MIT © [Fredrik Forsmo](https://github.com/frozzare)
## Instruction:
Remove my name from license readme
## Code After:
Validate Swedish social security numbers.
Install the module with npm:
```
$ npm install is-personnummer
```
or with Bower, with AMD and browser support:
```
$ bower install is-personnummer
```
or as cli:
```
$ npm install -g is-personnummer
$ is-personnummer 510818-9167
$ true
```
## Example
```javascript
$ node
> var isPersonnummer = require('is-personnummer');
undefined
> isPersonnummer('510818-9167');
true
> isPersonnummer('19130401+2931')
true
> isPersonnummer('196408233234')
true
> isPersonnummer('510818-916')
false
> isPersonnummer('19130401+293')
false
> isPersonnummer('19640823323')
false
```
See [test.js](test.js) for more examples.
## License
MIT
|
Validate Swedish social security numbers.
Install the module with npm:
```
$ npm install is-personnummer
```
or with Bower, with AMD and browser support:
```
$ bower install is-personnummer
```
or as cli:
```
$ npm install -g is-personnummer
$ is-personnummer 510818-9167
$ true
```
## Example
```javascript
$ node
> var isPersonnummer = require('is-personnummer');
undefined
> isPersonnummer('510818-9167');
true
> isPersonnummer('19130401+2931')
true
> isPersonnummer('196408233234')
true
> isPersonnummer('510818-916')
false
> isPersonnummer('19130401+293')
false
> isPersonnummer('19640823323')
false
```
See [test.js](test.js) for more examples.
## License
- MIT © [Fredrik Forsmo](https://github.com/frozzare)
+ MIT | 2 | 0.041667 | 1 | 1 |
a9560f998ff0cbfd9df72e70262b015a26aa1df1 | README.md | README.md |
```sh
$ npm install laravel-elixir-handlebars --save-dev
```
### Example
```javascript
var elixir = require('laravel-elixir');
require('laravel-elixir-handlebars');
elixir(function (mix) {
// Handlebar templates
mix.templates('templates', {
srcDir: 'resources/assets', // Default
outputFile: 'templates.js'
});
});
``` |
```sh
$ npm install laravel-elixir-handlebars --save-dev
```
### Example
```javascript
var elixir = require('laravel-elixir');
require('laravel-elixir-handlebars');
elixir(function (mix) {
// Handlebar templates
mix.templates([
'templates/**/*.hbs' // Will search in 'resources/views/templates'
]);
});
``` | Update readme to Laravel Elixir 3 | Update readme to Laravel Elixir 3
| Markdown | mit | Torann/laravel-elixir-handlebars | markdown | ## Code Before:
```sh
$ npm install laravel-elixir-handlebars --save-dev
```
### Example
```javascript
var elixir = require('laravel-elixir');
require('laravel-elixir-handlebars');
elixir(function (mix) {
// Handlebar templates
mix.templates('templates', {
srcDir: 'resources/assets', // Default
outputFile: 'templates.js'
});
});
```
## Instruction:
Update readme to Laravel Elixir 3
## Code After:
```sh
$ npm install laravel-elixir-handlebars --save-dev
```
### Example
```javascript
var elixir = require('laravel-elixir');
require('laravel-elixir-handlebars');
elixir(function (mix) {
// Handlebar templates
mix.templates([
'templates/**/*.hbs' // Will search in 'resources/views/templates'
]);
});
``` |
```sh
$ npm install laravel-elixir-handlebars --save-dev
```
### Example
```javascript
var elixir = require('laravel-elixir');
require('laravel-elixir-handlebars');
elixir(function (mix) {
// Handlebar templates
+ mix.templates([
+ 'templates/**/*.hbs' // Will search in 'resources/views/templates'
- mix.templates('templates', {
- srcDir: 'resources/assets', // Default
- outputFile: 'templates.js'
- });
? ^
+ ]);
? ^
-
});
``` | 8 | 0.363636 | 3 | 5 |
b4aed4c8ed0e8478a4ade43caee4de87940b72da | requirements.txt | requirements.txt | Django>=1.7.2
django-extensions>=1.4.9
helen-electricity-usage>=0.0.3
huawei-b593-status>=0.0.1
ledcontroller>=1.0.6
requests>=2.5.1
wakeonlan>=0.2.2
xmltodict>=0.9.0
manage_server_power>=0.0.1
numpy
django-websocket-redis
hiredis>=0.1.4
astral
| Django>=1.7.2
django-extensions>=1.4.9
helen-electricity-usage>=0.0.3
huawei-b593-status>=0.0.1
ledcontroller>=1.0.6
requests>=2.5.1
wakeonlan>=0.2.2
xmltodict>=0.9.0
manage_server_power>=0.0.1
numpy
django-websocket-redis
hiredis>=0.1.4
astral
setproctitle
| Add missing dependency for f2d88f1 | Add missing dependency for f2d88f1
| Text | bsd-3-clause | ojarva/home-info-display,ojarva/home-info-display,ojarva/home-info-display,ojarva/home-info-display | text | ## Code Before:
Django>=1.7.2
django-extensions>=1.4.9
helen-electricity-usage>=0.0.3
huawei-b593-status>=0.0.1
ledcontroller>=1.0.6
requests>=2.5.1
wakeonlan>=0.2.2
xmltodict>=0.9.0
manage_server_power>=0.0.1
numpy
django-websocket-redis
hiredis>=0.1.4
astral
## Instruction:
Add missing dependency for f2d88f1
## Code After:
Django>=1.7.2
django-extensions>=1.4.9
helen-electricity-usage>=0.0.3
huawei-b593-status>=0.0.1
ledcontroller>=1.0.6
requests>=2.5.1
wakeonlan>=0.2.2
xmltodict>=0.9.0
manage_server_power>=0.0.1
numpy
django-websocket-redis
hiredis>=0.1.4
astral
setproctitle
| Django>=1.7.2
django-extensions>=1.4.9
helen-electricity-usage>=0.0.3
huawei-b593-status>=0.0.1
ledcontroller>=1.0.6
requests>=2.5.1
wakeonlan>=0.2.2
xmltodict>=0.9.0
manage_server_power>=0.0.1
numpy
django-websocket-redis
hiredis>=0.1.4
astral
+ setproctitle | 1 | 0.076923 | 1 | 0 |
316b55ae374045ba62591d417aa19a51470d5f0c | README.mkd | README.mkd | You've spent hours, days, months, maybe **years** customizing your terminal. And yet so many things draw your attention away from it.
GONE are the days of wasting non-terminal moments looking up the current weather! Now, ask your terminal:
$ weather portland,me
It's 6° and light snow
Thank you, terminal--I think I *will* spend more time inside with you.
BUT WAIT, THERE'S MOAR!!
You can now set your location as an environment variable `WEATHER` and never have to type that query again!
$ export WEATHER=portland,me && weather
It's 6° and light snow
$ weather
It's 6° and light snow
The query you pass in will override the environment variable, though, so you can still check how people in less-fortunate climates are faring:
$ export WEATHER=portland,me && weather "los angeles,ca"
It's 76° and sunny
Install
-------
Installation couldn't be easier:
$ pip install weathercli
(This is, of course, after you've run `easy_install pip` and `pip install --upgrade pip`. Simple!)
| You've spent hours, days, months, maybe **years** customizing your terminal. And yet so many things draw your attention away from it.
GONE are the days of wasting non-terminal moments looking up the current weather! Now, ask your terminal:
$ weather portland,me
It's 6° and light snow
Thank you, terminal--I think I *will* spend more time inside with you.
BUT WAIT, THERE'S MOAR!!
You can now set your location as an environment variable `WEATHER` and never have to type that query again!
$ export WEATHER=portland,me && weather
It's 6° and light snow
$ weather
It's 6° and light snow
The query you pass in will override the environment variable, though, so you can still check how people in less-fortunate climates are faring:
$ export WEATHER=portland,me && weather "los angeles,ca"
It's 76° and sunny
Live in one of those metric countries, you say? No problem!
$ weather "tokyo,jp" --units celcius
It's 8° and sky is clear
Read more at:
$ weather -h
Install
-------
Installation couldn't be easier:
$ pip install weathercli
(This is, of course, after you've run `easy_install pip` and `pip install --upgrade pip`. Simple!)
| Update readme with units param | Update readme with units param
| Markdown | bsd-2-clause | brianriley/weather-cli | markdown | ## Code Before:
You've spent hours, days, months, maybe **years** customizing your terminal. And yet so many things draw your attention away from it.
GONE are the days of wasting non-terminal moments looking up the current weather! Now, ask your terminal:
$ weather portland,me
It's 6° and light snow
Thank you, terminal--I think I *will* spend more time inside with you.
BUT WAIT, THERE'S MOAR!!
You can now set your location as an environment variable `WEATHER` and never have to type that query again!
$ export WEATHER=portland,me && weather
It's 6° and light snow
$ weather
It's 6° and light snow
The query you pass in will override the environment variable, though, so you can still check how people in less-fortunate climates are faring:
$ export WEATHER=portland,me && weather "los angeles,ca"
It's 76° and sunny
Install
-------
Installation couldn't be easier:
$ pip install weathercli
(This is, of course, after you've run `easy_install pip` and `pip install --upgrade pip`. Simple!)
## Instruction:
Update readme with units param
## Code After:
You've spent hours, days, months, maybe **years** customizing your terminal. And yet so many things draw your attention away from it.
GONE are the days of wasting non-terminal moments looking up the current weather! Now, ask your terminal:
$ weather portland,me
It's 6° and light snow
Thank you, terminal--I think I *will* spend more time inside with you.
BUT WAIT, THERE'S MOAR!!
You can now set your location as an environment variable `WEATHER` and never have to type that query again!
$ export WEATHER=portland,me && weather
It's 6° and light snow
$ weather
It's 6° and light snow
The query you pass in will override the environment variable, though, so you can still check how people in less-fortunate climates are faring:
$ export WEATHER=portland,me && weather "los angeles,ca"
It's 76° and sunny
Live in one of those metric countries, you say? No problem!
$ weather "tokyo,jp" --units celcius
It's 8° and sky is clear
Read more at:
$ weather -h
Install
-------
Installation couldn't be easier:
$ pip install weathercli
(This is, of course, after you've run `easy_install pip` and `pip install --upgrade pip`. Simple!)
| You've spent hours, days, months, maybe **years** customizing your terminal. And yet so many things draw your attention away from it.
GONE are the days of wasting non-terminal moments looking up the current weather! Now, ask your terminal:
$ weather portland,me
It's 6° and light snow
Thank you, terminal--I think I *will* spend more time inside with you.
BUT WAIT, THERE'S MOAR!!
You can now set your location as an environment variable `WEATHER` and never have to type that query again!
$ export WEATHER=portland,me && weather
It's 6° and light snow
$ weather
It's 6° and light snow
The query you pass in will override the environment variable, though, so you can still check how people in less-fortunate climates are faring:
$ export WEATHER=portland,me && weather "los angeles,ca"
It's 76° and sunny
+ Live in one of those metric countries, you say? No problem!
+
+ $ weather "tokyo,jp" --units celcius
+ It's 8° and sky is clear
+
+ Read more at:
+
+ $ weather -h
+
Install
-------
Installation couldn't be easier:
$ pip install weathercli
(This is, of course, after you've run `easy_install pip` and `pip install --upgrade pip`. Simple!) | 9 | 0.290323 | 9 | 0 |
662a48b3ded406c6f23f98d71fa1221837b71d46 | app/controllers/pages_controller.rb | app/controllers/pages_controller.rb | class PagesController < ApplicationController
skip_load_and_authorize_resource
before_action :suppress_hotline_link
def tandcs; end
def contact_us; end
def api_landing; end
def api_release_notes; end
def servicedown; end
def timed_retention; end
end
| class PagesController < ApplicationController
skip_load_and_authorize_resource
before_action :suppress_hotline_link
def tandcs; end
def contact_us; end
def api_landing; end
def api_release_notes; end
def servicedown
respond_to do |format|
format.html { render :servicedown, status: 503 }
format.json { render json: [{ error: 'Temporarily unavailable' }], status: 503 }
end
end
def timed_retention; end
end
| Add ability for servicedown to respond to json | Add ability for servicedown to respond to json
API queries should also respond in kind
and indicate that service is unavailable.
| Ruby | mit | ministryofjustice/advocate-defence-payments,ministryofjustice/advocate-defence-payments,ministryofjustice/advocate-defence-payments,ministryofjustice/advocate-defence-payments | ruby | ## Code Before:
class PagesController < ApplicationController
skip_load_and_authorize_resource
before_action :suppress_hotline_link
def tandcs; end
def contact_us; end
def api_landing; end
def api_release_notes; end
def servicedown; end
def timed_retention; end
end
## Instruction:
Add ability for servicedown to respond to json
API queries should also respond in kind
and indicate that service is unavailable.
## Code After:
class PagesController < ApplicationController
skip_load_and_authorize_resource
before_action :suppress_hotline_link
def tandcs; end
def contact_us; end
def api_landing; end
def api_release_notes; end
def servicedown
respond_to do |format|
format.html { render :servicedown, status: 503 }
format.json { render json: [{ error: 'Temporarily unavailable' }], status: 503 }
end
end
def timed_retention; end
end
| class PagesController < ApplicationController
skip_load_and_authorize_resource
before_action :suppress_hotline_link
def tandcs; end
def contact_us; end
def api_landing; end
def api_release_notes; end
- def servicedown; end
? -----
+ def servicedown
+ respond_to do |format|
+ format.html { render :servicedown, status: 503 }
+ format.json { render json: [{ error: 'Temporarily unavailable' }], status: 503 }
+ end
+ end
def timed_retention; end
end | 7 | 0.4375 | 6 | 1 |
189373b7775196ac459dc9ec19ac97b65cd5d8c5 | .travis.yml | .travis.yml | language: node_js
node_js:
- '0.12'
- '0.10'
- iojs
script:
- npm run coverage
| language: node_js
node_js:
- '0.12'
- '0.10'
script:
- npm run coverage
after_script:
- 'npm install codeclimate-test-reporter && cat coverage/lcov.info | codeclimate'
env:
global:
- secure: F4BaY+LtFcpQcFNnWAux+9qBchxaDPYeLF7IruLFoSKWLByMcAgRC8nUrJrgzktRV4KMYdGy+Tf+kwMUB4zBtzKs/DkJ/TxgfLlXLsy8PVg75bnSkjORySUcpz4r8YykFl52rhJZ8+biTOSrfauBPfYL6zCBOd/RjjGK1tlM5zbd17emn8+ZZqAw9xrVDBxwdK1UJZVmNZI7v1bjh2rGvQNmUcgnLQW+na3kLtfoo2OyjSakJGRd5rPrElM7PI+wV3NdNBnZhxgA7Kdk9CQ7GqLFgD+IGyoh5WLXT5vsja/WWnbPSX/c3gKq5XL9PjvhWr26FqupDVKYN1PSN/XEyWZfSikQdrhgUeumQV4UnMLbSpsJxVlpsXF14y//8wff7I4aQj5RQ4EvGzGVu8WB1+gAJbBN9l0/YrStE2lKuElDsF4KyQSQ+hQDDNI94zMypiE+ICmADM8e4y8zeA5/aumInv1Lqy2ouayaxEqH1M9hPSd+IE8y+FWb/eJg9NbX3B7vQWBnw+vkxqcuL0OZDM48xWEkJpnDwN4OLeLS4nn9EbyKtLQTAkPDmnlX2ErDcOoc1kAFq4+H1wQAZKhEhwLW2n4bHHN+DcPFCeVrxHHjh28hLUYcaMMLSYCuA4lHxG/5CzmR67ofzf+SCYNX3R9usSYNUBjHNUAzB/7kpcs=
| Remove iojs from CI until bug is fixed. Add codeclimate reporting | Remove iojs from CI until bug is fixed. Add codeclimate reporting
| YAML | mit | vgno/ssehub-storage-leveldb | yaml | ## Code Before:
language: node_js
node_js:
- '0.12'
- '0.10'
- iojs
script:
- npm run coverage
## Instruction:
Remove iojs from CI until bug is fixed. Add codeclimate reporting
## Code After:
language: node_js
node_js:
- '0.12'
- '0.10'
script:
- npm run coverage
after_script:
- 'npm install codeclimate-test-reporter && cat coverage/lcov.info | codeclimate'
env:
global:
- secure: F4BaY+LtFcpQcFNnWAux+9qBchxaDPYeLF7IruLFoSKWLByMcAgRC8nUrJrgzktRV4KMYdGy+Tf+kwMUB4zBtzKs/DkJ/TxgfLlXLsy8PVg75bnSkjORySUcpz4r8YykFl52rhJZ8+biTOSrfauBPfYL6zCBOd/RjjGK1tlM5zbd17emn8+ZZqAw9xrVDBxwdK1UJZVmNZI7v1bjh2rGvQNmUcgnLQW+na3kLtfoo2OyjSakJGRd5rPrElM7PI+wV3NdNBnZhxgA7Kdk9CQ7GqLFgD+IGyoh5WLXT5vsja/WWnbPSX/c3gKq5XL9PjvhWr26FqupDVKYN1PSN/XEyWZfSikQdrhgUeumQV4UnMLbSpsJxVlpsXF14y//8wff7I4aQj5RQ4EvGzGVu8WB1+gAJbBN9l0/YrStE2lKuElDsF4KyQSQ+hQDDNI94zMypiE+ICmADM8e4y8zeA5/aumInv1Lqy2ouayaxEqH1M9hPSd+IE8y+FWb/eJg9NbX3B7vQWBnw+vkxqcuL0OZDM48xWEkJpnDwN4OLeLS4nn9EbyKtLQTAkPDmnlX2ErDcOoc1kAFq4+H1wQAZKhEhwLW2n4bHHN+DcPFCeVrxHHjh28hLUYcaMMLSYCuA4lHxG/5CzmR67ofzf+SCYNX3R9usSYNUBjHNUAzB/7kpcs=
| language: node_js
node_js:
- '0.12'
- '0.10'
- - iojs
script:
- npm run coverage
-
-
+ after_script:
+ - 'npm install codeclimate-test-reporter && cat coverage/lcov.info | codeclimate'
+ env:
+ global:
+ - secure: F4BaY+LtFcpQcFNnWAux+9qBchxaDPYeLF7IruLFoSKWLByMcAgRC8nUrJrgzktRV4KMYdGy+Tf+kwMUB4zBtzKs/DkJ/TxgfLlXLsy8PVg75bnSkjORySUcpz4r8YykFl52rhJZ8+biTOSrfauBPfYL6zCBOd/RjjGK1tlM5zbd17emn8+ZZqAw9xrVDBxwdK1UJZVmNZI7v1bjh2rGvQNmUcgnLQW+na3kLtfoo2OyjSakJGRd5rPrElM7PI+wV3NdNBnZhxgA7Kdk9CQ7GqLFgD+IGyoh5WLXT5vsja/WWnbPSX/c3gKq5XL9PjvhWr26FqupDVKYN1PSN/XEyWZfSikQdrhgUeumQV4UnMLbSpsJxVlpsXF14y//8wff7I4aQj5RQ4EvGzGVu8WB1+gAJbBN9l0/YrStE2lKuElDsF4KyQSQ+hQDDNI94zMypiE+ICmADM8e4y8zeA5/aumInv1Lqy2ouayaxEqH1M9hPSd+IE8y+FWb/eJg9NbX3B7vQWBnw+vkxqcuL0OZDM48xWEkJpnDwN4OLeLS4nn9EbyKtLQTAkPDmnlX2ErDcOoc1kAFq4+H1wQAZKhEhwLW2n4bHHN+DcPFCeVrxHHjh28hLUYcaMMLSYCuA4lHxG/5CzmR67ofzf+SCYNX3R9usSYNUBjHNUAzB/7kpcs= | 8 | 0.888889 | 5 | 3 |
533fb181d525a5683b92f9cabc73363abdef5844 | app/Models/Post.php | app/Models/Post.php | <?php
namespace Rogue\Models;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['event_id', 'signup_id', 'northstar_id'];
protected $primaryKey = ['event_id'];
// protected $with = ['content'];
/**
* Indicates if the IDs are auto-incrementing.
*
* @var bool
*/
public $incrementing = false;
/**
* Returns Post data
*
* @return \Illuminate\Database\Eloquent\Relations\MorphTo
*/
public function content()
{
return $this->morphTo('postable');
}
/**
* Each post has events.
*/
public function events()
{
return $this->morphMany(Event::class, 'eventable');
}
/**
* Each post belongs to a signup.
*/
public function signup()
{
return $this->belongsTo(Signup::class);
}
/**
* Each post has one review.
*/
public function review()
{
return $this->hasOne(Review::class);
}
/**
* Get the reactions associated with this post.
*/
public function reactions()
{
return $this->hasMany(Reaction::class);
}
}
| <?php
namespace Rogue\Models;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['id', 'signup_id', 'northstar_id', 'url', 'caption', 'status', 'source', 'remote_addr'];
/**
* Each post has events.
*/
public function events()
{
return $this->morphMany(Event::class, 'eventable');
}
/**
* Each post belongs to a signup.
*/
public function signup()
{
return $this->belongsTo(Signup::class);
}
/**
* Each post has one review.
*/
public function review()
{
return $this->hasOne(Review::class);
}
/**
* Get the reactions associated with this post.
*/
public function reactions()
{
return $this->hasMany(Reaction::class);
}
}
| Fix a bad merge conflict resolution | Fix a bad merge conflict resolution
| PHP | mit | DoSomething/rogue,DoSomething/rogue,DoSomething/rogue | php | ## Code Before:
<?php
namespace Rogue\Models;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['event_id', 'signup_id', 'northstar_id'];
protected $primaryKey = ['event_id'];
// protected $with = ['content'];
/**
* Indicates if the IDs are auto-incrementing.
*
* @var bool
*/
public $incrementing = false;
/**
* Returns Post data
*
* @return \Illuminate\Database\Eloquent\Relations\MorphTo
*/
public function content()
{
return $this->morphTo('postable');
}
/**
* Each post has events.
*/
public function events()
{
return $this->morphMany(Event::class, 'eventable');
}
/**
* Each post belongs to a signup.
*/
public function signup()
{
return $this->belongsTo(Signup::class);
}
/**
* Each post has one review.
*/
public function review()
{
return $this->hasOne(Review::class);
}
/**
* Get the reactions associated with this post.
*/
public function reactions()
{
return $this->hasMany(Reaction::class);
}
}
## Instruction:
Fix a bad merge conflict resolution
## Code After:
<?php
namespace Rogue\Models;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['id', 'signup_id', 'northstar_id', 'url', 'caption', 'status', 'source', 'remote_addr'];
/**
* Each post has events.
*/
public function events()
{
return $this->morphMany(Event::class, 'eventable');
}
/**
* Each post belongs to a signup.
*/
public function signup()
{
return $this->belongsTo(Signup::class);
}
/**
* Each post has one review.
*/
public function review()
{
return $this->hasOne(Review::class);
}
/**
* Get the reactions associated with this post.
*/
public function reactions()
{
return $this->hasMany(Reaction::class);
}
}
| <?php
namespace Rogue\Models;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
+ protected $fillable = ['id', 'signup_id', 'northstar_id', 'url', 'caption', 'status', 'source', 'remote_addr'];
- protected $fillable = ['event_id', 'signup_id', 'northstar_id'];
-
- protected $primaryKey = ['event_id'];
-
- // protected $with = ['content'];
-
- /**
- * Indicates if the IDs are auto-incrementing.
- *
- * @var bool
- */
- public $incrementing = false;
-
- /**
- * Returns Post data
- *
- * @return \Illuminate\Database\Eloquent\Relations\MorphTo
- */
- public function content()
- {
- return $this->morphTo('postable');
- }
/**
* Each post has events.
*/
public function events()
{
return $this->morphMany(Event::class, 'eventable');
}
/**
* Each post belongs to a signup.
*/
public function signup()
{
return $this->belongsTo(Signup::class);
}
/**
* Each post has one review.
*/
public function review()
{
return $this->hasOne(Review::class);
}
/**
* Get the reactions associated with this post.
*/
public function reactions()
{
return $this->hasMany(Reaction::class);
}
} | 23 | 0.338235 | 1 | 22 |
15bfe88ebf11a6f1ca19e1dd1e62a82cd9f6379e | puppet/modules/elasticsearch/templates/CirrusSearch.php.erb | puppet/modules/elasticsearch/templates/CirrusSearch.php.erb |
include_once "$IP/extensions/CirrusSearch/tests/jenkins/FullyFeaturedConfig.php";
$wgCirrusSearchExtraIndexes[ NS_FILE ] = array( 'commonswiki_file' );
$wgMWLoggerDefaultSpi['args'][0]['loggers']['CirrusSearchRequestSet'] = array(
'handlers' => array( 'kafka' ),
'processors' => array(),
'calls' => array()
);
$wgMWLoggerDefaultSpi['args'][0]['handlers']['kafka'] = array(
'factory' => '\\MediaWiki\\Logger\\Monolog\\KafkaHandler::factory',
'args' => array(
array( 'localhost:9092' ),
array(
'alias' => array(),
'swallowExceptions' => false,
'logExceptions' => null,
)
),
'formatter' => 'avro',
);
$wgMWLoggerDefaultSpi['args'][0]['formatters']['avro'] = array(
'class' => '\\MediaWiki\\Logger\\Monolog\\AvroFormatter',
'args' => array(
array(
'CirrusSearchRequestSet' => array(
'schema' => file_get_contents(
"<%= scope['::service::root_dir'] %>/event-schemas/avro/mediawiki/CirrusSearchRequestSet/111448028943.avsc"
),
'revision' => 111448028943,
),
),
),
);
|
include_once "$IP/extensions/CirrusSearch/tests/jenkins/FullyFeaturedConfig.php";
$wgCirrusSearchExtraIndexes[ NS_FILE ] = array( 'commonswiki_file' );
$wgMWLoggerDefaultSpi['args'][0]['loggers']['CirrusSearchRequestSet'] = array(
'handlers' => array( 'kafka' ),
'processors' => array(),
'calls' => array()
);
$wgMWLoggerDefaultSpi['args'][0]['handlers']['kafka'] = array(
'factory' => '\\MediaWiki\\Logger\\Monolog\\KafkaHandler::factory',
'args' => array(
array( 'localhost:9092' ),
array(
'alias' => array(),
'swallowExceptions' => false,
'logExceptions' => null,
)
),
'formatter' => 'avro',
);
$wgMWLoggerDefaultSpi['args'][0]['formatters']['avro'] = array(
'class' => '\\MediaWiki\\Logger\\Monolog\\AvroFormatter',
'args' => array(
array(
'CirrusSearchRequestSet' => array(
'schema' => file_get_contents(
"<%= scope['::service::root_dir'] %>/event-schemas/avro/mediawiki/CirrusSearchRequestSet/121456865906.avsc"
),
'revision' => 121456865906,
),
),
),
);
| Update CirrusSearchRequestSet schema to latest version | Update CirrusSearchRequestSet schema to latest version
Depends-On: I1f194cc318c18e7c292c5450ea011811de8df204
Change-Id: I3bbc1e809a40a408c820a43f651c0624cf9675c5
Bug: T128533
| HTML+ERB | mit | stuartbman/mediawiki-vagrant,stuartbman/mediawiki-vagrant,wikimedia/mediawiki-vagrant,stuartbman/mediawiki-vagrant,wikimedia/mediawiki-vagrant,wikimedia/mediawiki-vagrant,stuartbman/mediawiki-vagrant,stuartbman/mediawiki-vagrant,wikimedia/mediawiki-vagrant,stuartbman/mediawiki-vagrant,wikimedia/mediawiki-vagrant,stuartbman/mediawiki-vagrant,wikimedia/mediawiki-vagrant | html+erb | ## Code Before:
include_once "$IP/extensions/CirrusSearch/tests/jenkins/FullyFeaturedConfig.php";
$wgCirrusSearchExtraIndexes[ NS_FILE ] = array( 'commonswiki_file' );
$wgMWLoggerDefaultSpi['args'][0]['loggers']['CirrusSearchRequestSet'] = array(
'handlers' => array( 'kafka' ),
'processors' => array(),
'calls' => array()
);
$wgMWLoggerDefaultSpi['args'][0]['handlers']['kafka'] = array(
'factory' => '\\MediaWiki\\Logger\\Monolog\\KafkaHandler::factory',
'args' => array(
array( 'localhost:9092' ),
array(
'alias' => array(),
'swallowExceptions' => false,
'logExceptions' => null,
)
),
'formatter' => 'avro',
);
$wgMWLoggerDefaultSpi['args'][0]['formatters']['avro'] = array(
'class' => '\\MediaWiki\\Logger\\Monolog\\AvroFormatter',
'args' => array(
array(
'CirrusSearchRequestSet' => array(
'schema' => file_get_contents(
"<%= scope['::service::root_dir'] %>/event-schemas/avro/mediawiki/CirrusSearchRequestSet/111448028943.avsc"
),
'revision' => 111448028943,
),
),
),
);
## Instruction:
Update CirrusSearchRequestSet schema to latest version
Depends-On: I1f194cc318c18e7c292c5450ea011811de8df204
Change-Id: I3bbc1e809a40a408c820a43f651c0624cf9675c5
Bug: T128533
## Code After:
include_once "$IP/extensions/CirrusSearch/tests/jenkins/FullyFeaturedConfig.php";
$wgCirrusSearchExtraIndexes[ NS_FILE ] = array( 'commonswiki_file' );
$wgMWLoggerDefaultSpi['args'][0]['loggers']['CirrusSearchRequestSet'] = array(
'handlers' => array( 'kafka' ),
'processors' => array(),
'calls' => array()
);
$wgMWLoggerDefaultSpi['args'][0]['handlers']['kafka'] = array(
'factory' => '\\MediaWiki\\Logger\\Monolog\\KafkaHandler::factory',
'args' => array(
array( 'localhost:9092' ),
array(
'alias' => array(),
'swallowExceptions' => false,
'logExceptions' => null,
)
),
'formatter' => 'avro',
);
$wgMWLoggerDefaultSpi['args'][0]['formatters']['avro'] = array(
'class' => '\\MediaWiki\\Logger\\Monolog\\AvroFormatter',
'args' => array(
array(
'CirrusSearchRequestSet' => array(
'schema' => file_get_contents(
"<%= scope['::service::root_dir'] %>/event-schemas/avro/mediawiki/CirrusSearchRequestSet/121456865906.avsc"
),
'revision' => 121456865906,
),
),
),
);
|
include_once "$IP/extensions/CirrusSearch/tests/jenkins/FullyFeaturedConfig.php";
$wgCirrusSearchExtraIndexes[ NS_FILE ] = array( 'commonswiki_file' );
$wgMWLoggerDefaultSpi['args'][0]['loggers']['CirrusSearchRequestSet'] = array(
'handlers' => array( 'kafka' ),
'processors' => array(),
'calls' => array()
);
$wgMWLoggerDefaultSpi['args'][0]['handlers']['kafka'] = array(
'factory' => '\\MediaWiki\\Logger\\Monolog\\KafkaHandler::factory',
'args' => array(
array( 'localhost:9092' ),
array(
'alias' => array(),
'swallowExceptions' => false,
'logExceptions' => null,
)
),
'formatter' => 'avro',
);
$wgMWLoggerDefaultSpi['args'][0]['formatters']['avro'] = array(
'class' => '\\MediaWiki\\Logger\\Monolog\\AvroFormatter',
'args' => array(
array(
'CirrusSearchRequestSet' => array(
'schema' => file_get_contents(
- "<%= scope['::service::root_dir'] %>/event-schemas/avro/mediawiki/CirrusSearchRequestSet/111448028943.avsc"
? ^ ^ ^^^^^
+ "<%= scope['::service::root_dir'] %>/event-schemas/avro/mediawiki/CirrusSearchRequestSet/121456865906.avsc"
? ^ ^^ +++ ^
),
- 'revision' => 111448028943,
? ^ ^ ^^^^^
+ 'revision' => 121456865906,
? ^ ^^ +++ ^
),
),
),
); | 4 | 0.111111 | 2 | 2 |
cd2a19c4134d2ffd198d1636ef42ee4553a11212 | app/views/news/index.atom.builder | app/views/news/index.atom.builder | atom_feed(:root_url => news_index_url, "xmlns:wfw" => "http://wellformedweb.org/CommentAPI/") do |feed|
if @user
feed.title("LinuxFr.org : les dépêches de #{@user.name}")
else
feed.title("LinuxFr.org : les dépêches")
end
feed.updated(@nodes.first.try :updated_at)
feed.icon("/favicon.png")
@nodes.map(&:content).each do |news|
feed.entry(news, :published => news.node.created_at) do |entry|
entry.title(news.title)
first = content_tag(:div, news.body)
links = content_tag(:ul, news.links.map.with_index do |l,i|
content_tag(:li, "lien n°#{i+1} : ".html_safe +
link_to(l.title, "http://#{MY_DOMAIN}/redirect/#{l.id}", :title => l.url, :hreflang => l.lang))
end.join.html_safe)
second = content_tag(:div, news.second_part)
entry.content(first + links + second, :type => 'html')
entry.author do |author|
author.name(news.author_name)
end
entry.wfw :commentRss, "http://#{MY_DOMAIN}/nodes/#{news.node.id}/comments.atom"
end
end
end
| atom_feed(:root_url => news_index_url, "xmlns:wfw" => "http://wellformedweb.org/CommentAPI/") do |feed|
if @user
feed.title("LinuxFr.org : les dépêches de #{@user.name}")
else
feed.title("LinuxFr.org : les dépêches")
end
feed.updated(@nodes.first.try :updated_at)
feed.icon("/favicon.png")
@nodes.map(&:content).each do |news|
feed.entry(news, :published => news.node.created_at) do |entry|
entry.title(news.title)
first = content_tag(:div, news.body)
links = content_tag(:ul, news.links.map.with_index do |l,i|
content_tag(:li, "lien n°#{i+1} : ".html_safe +
link_to(l.title, "http://#{MY_DOMAIN}/redirect/#{l.id}", :title => l.url, :hreflang => l.lang))
end.join.html_safe)
second = content_tag(:div, news.second_part)
entry.content(first + links + second, :type => 'html')
entry.author do |author|
author.name(news.author_name)
end
entry.category(:term => news.section.title)
entry.wfw :commentRss, "http://#{MY_DOMAIN}/nodes/#{news.node.id}/comments.atom"
end
end
end
| Add category in news feed. | Add category in news feed.
Signed-off-by: François de Metz <5187da0b934cc25eb2201a3ec9206c24b13cb23b@2metz.fr>
| Ruby | agpl-3.0 | linuxfrorg/linuxfr.org,cykl/linuxfr.org,cykl/linuxfr.org,linuxfrorg/linuxfr.org,linuxfrorg/linuxfr.org,linuxfrorg/linuxfr.org | ruby | ## Code Before:
atom_feed(:root_url => news_index_url, "xmlns:wfw" => "http://wellformedweb.org/CommentAPI/") do |feed|
if @user
feed.title("LinuxFr.org : les dépêches de #{@user.name}")
else
feed.title("LinuxFr.org : les dépêches")
end
feed.updated(@nodes.first.try :updated_at)
feed.icon("/favicon.png")
@nodes.map(&:content).each do |news|
feed.entry(news, :published => news.node.created_at) do |entry|
entry.title(news.title)
first = content_tag(:div, news.body)
links = content_tag(:ul, news.links.map.with_index do |l,i|
content_tag(:li, "lien n°#{i+1} : ".html_safe +
link_to(l.title, "http://#{MY_DOMAIN}/redirect/#{l.id}", :title => l.url, :hreflang => l.lang))
end.join.html_safe)
second = content_tag(:div, news.second_part)
entry.content(first + links + second, :type => 'html')
entry.author do |author|
author.name(news.author_name)
end
entry.wfw :commentRss, "http://#{MY_DOMAIN}/nodes/#{news.node.id}/comments.atom"
end
end
end
## Instruction:
Add category in news feed.
Signed-off-by: François de Metz <5187da0b934cc25eb2201a3ec9206c24b13cb23b@2metz.fr>
## Code After:
atom_feed(:root_url => news_index_url, "xmlns:wfw" => "http://wellformedweb.org/CommentAPI/") do |feed|
if @user
feed.title("LinuxFr.org : les dépêches de #{@user.name}")
else
feed.title("LinuxFr.org : les dépêches")
end
feed.updated(@nodes.first.try :updated_at)
feed.icon("/favicon.png")
@nodes.map(&:content).each do |news|
feed.entry(news, :published => news.node.created_at) do |entry|
entry.title(news.title)
first = content_tag(:div, news.body)
links = content_tag(:ul, news.links.map.with_index do |l,i|
content_tag(:li, "lien n°#{i+1} : ".html_safe +
link_to(l.title, "http://#{MY_DOMAIN}/redirect/#{l.id}", :title => l.url, :hreflang => l.lang))
end.join.html_safe)
second = content_tag(:div, news.second_part)
entry.content(first + links + second, :type => 'html')
entry.author do |author|
author.name(news.author_name)
end
entry.category(:term => news.section.title)
entry.wfw :commentRss, "http://#{MY_DOMAIN}/nodes/#{news.node.id}/comments.atom"
end
end
end
| atom_feed(:root_url => news_index_url, "xmlns:wfw" => "http://wellformedweb.org/CommentAPI/") do |feed|
if @user
feed.title("LinuxFr.org : les dépêches de #{@user.name}")
else
feed.title("LinuxFr.org : les dépêches")
end
feed.updated(@nodes.first.try :updated_at)
feed.icon("/favicon.png")
@nodes.map(&:content).each do |news|
feed.entry(news, :published => news.node.created_at) do |entry|
entry.title(news.title)
first = content_tag(:div, news.body)
links = content_tag(:ul, news.links.map.with_index do |l,i|
content_tag(:li, "lien n°#{i+1} : ".html_safe +
link_to(l.title, "http://#{MY_DOMAIN}/redirect/#{l.id}", :title => l.url, :hreflang => l.lang))
end.join.html_safe)
second = content_tag(:div, news.second_part)
entry.content(first + links + second, :type => 'html')
entry.author do |author|
author.name(news.author_name)
end
+ entry.category(:term => news.section.title)
entry.wfw :commentRss, "http://#{MY_DOMAIN}/nodes/#{news.node.id}/comments.atom"
end
end
end | 1 | 0.038462 | 1 | 0 |
48db0346ceb93254ffbe7ffdf795e162867aa8e8 | tests/CMakeLists.txt | tests/CMakeLists.txt | project(tests C)
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMOCKA_INCLUDE_DIR}
)
set(TORTURE_LIBRARY torture)
# RFC862 echo server
add_executable(echo_srv echo_srv.c)
add_library(${TORTURE_LIBRARY} STATIC torture.c)
target_link_libraries(${TORTURE_LIBRARY}
${CMOCKA_LIBRARY}
${SWRAP_REQUIRED_LIBRARIES})
set(SWRAP_TESTS testsuite test_echo_udp_sendto_recvfrom)
foreach(_SWRAP_TEST ${SWRAP_TESTS})
add_cmocka_test(${_SWRAP_TEST} ${_SWRAP_TEST}.c ${TORTURE_LIBRARY})
if (OSX)
set_property(
TEST
${_SWRAP_TEST}
PROPERTY
ENVIRONMENT DYLD_FORCE_FLAT_NAMESPACE=1;DYLD_INSERT_LIBRARIES=${CMAKE_BINARY_DIR}/src/libsocket_wrapper.dylib)
else ()
set_property(
TEST
${_SWRAP_TEST}
PROPERTY
ENVIRONMENT LD_PRELOAD=${CMAKE_BINARY_DIR}/src/libsocket_wrapper.so)
endif()
endforeach()
| project(tests C)
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMOCKA_INCLUDE_DIR}
)
set(TORTURE_LIBRARY torture)
# RFC862 echo server
add_executable(echo_srv echo_srv.c)
target_link_libraries(echo_srv ${SWRAP_REQUIRED_LIBRARIES})
add_library(${TORTURE_LIBRARY} STATIC torture.c)
target_link_libraries(${TORTURE_LIBRARY}
${CMOCKA_LIBRARY}
${SWRAP_REQUIRED_LIBRARIES})
set(SWRAP_TESTS testsuite test_echo_udp_sendto_recvfrom)
foreach(_SWRAP_TEST ${SWRAP_TESTS})
add_cmocka_test(${_SWRAP_TEST} ${_SWRAP_TEST}.c ${TORTURE_LIBRARY})
if (OSX)
set_property(
TEST
${_SWRAP_TEST}
PROPERTY
ENVIRONMENT DYLD_FORCE_FLAT_NAMESPACE=1;DYLD_INSERT_LIBRARIES=${CMAKE_BINARY_DIR}/src/libsocket_wrapper.dylib)
else ()
set_property(
TEST
${_SWRAP_TEST}
PROPERTY
ENVIRONMENT LD_PRELOAD=${CMAKE_BINARY_DIR}/src/libsocket_wrapper.so)
endif()
endforeach()
| Fix linking echo_srv on Solaris. | cmake: Fix linking echo_srv on Solaris.
| Text | bsd-3-clause | jhrozek/socket_wrapper,jhrozek/socket_wrapper,anoopcs9/socket_wrapper,anoopcs9/socket_wrapper | text | ## Code Before:
project(tests C)
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMOCKA_INCLUDE_DIR}
)
set(TORTURE_LIBRARY torture)
# RFC862 echo server
add_executable(echo_srv echo_srv.c)
add_library(${TORTURE_LIBRARY} STATIC torture.c)
target_link_libraries(${TORTURE_LIBRARY}
${CMOCKA_LIBRARY}
${SWRAP_REQUIRED_LIBRARIES})
set(SWRAP_TESTS testsuite test_echo_udp_sendto_recvfrom)
foreach(_SWRAP_TEST ${SWRAP_TESTS})
add_cmocka_test(${_SWRAP_TEST} ${_SWRAP_TEST}.c ${TORTURE_LIBRARY})
if (OSX)
set_property(
TEST
${_SWRAP_TEST}
PROPERTY
ENVIRONMENT DYLD_FORCE_FLAT_NAMESPACE=1;DYLD_INSERT_LIBRARIES=${CMAKE_BINARY_DIR}/src/libsocket_wrapper.dylib)
else ()
set_property(
TEST
${_SWRAP_TEST}
PROPERTY
ENVIRONMENT LD_PRELOAD=${CMAKE_BINARY_DIR}/src/libsocket_wrapper.so)
endif()
endforeach()
## Instruction:
cmake: Fix linking echo_srv on Solaris.
## Code After:
project(tests C)
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMOCKA_INCLUDE_DIR}
)
set(TORTURE_LIBRARY torture)
# RFC862 echo server
add_executable(echo_srv echo_srv.c)
target_link_libraries(echo_srv ${SWRAP_REQUIRED_LIBRARIES})
add_library(${TORTURE_LIBRARY} STATIC torture.c)
target_link_libraries(${TORTURE_LIBRARY}
${CMOCKA_LIBRARY}
${SWRAP_REQUIRED_LIBRARIES})
set(SWRAP_TESTS testsuite test_echo_udp_sendto_recvfrom)
foreach(_SWRAP_TEST ${SWRAP_TESTS})
add_cmocka_test(${_SWRAP_TEST} ${_SWRAP_TEST}.c ${TORTURE_LIBRARY})
if (OSX)
set_property(
TEST
${_SWRAP_TEST}
PROPERTY
ENVIRONMENT DYLD_FORCE_FLAT_NAMESPACE=1;DYLD_INSERT_LIBRARIES=${CMAKE_BINARY_DIR}/src/libsocket_wrapper.dylib)
else ()
set_property(
TEST
${_SWRAP_TEST}
PROPERTY
ENVIRONMENT LD_PRELOAD=${CMAKE_BINARY_DIR}/src/libsocket_wrapper.so)
endif()
endforeach()
| project(tests C)
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMOCKA_INCLUDE_DIR}
)
set(TORTURE_LIBRARY torture)
# RFC862 echo server
add_executable(echo_srv echo_srv.c)
+ target_link_libraries(echo_srv ${SWRAP_REQUIRED_LIBRARIES})
add_library(${TORTURE_LIBRARY} STATIC torture.c)
target_link_libraries(${TORTURE_LIBRARY}
${CMOCKA_LIBRARY}
${SWRAP_REQUIRED_LIBRARIES})
set(SWRAP_TESTS testsuite test_echo_udp_sendto_recvfrom)
foreach(_SWRAP_TEST ${SWRAP_TESTS})
add_cmocka_test(${_SWRAP_TEST} ${_SWRAP_TEST}.c ${TORTURE_LIBRARY})
if (OSX)
set_property(
TEST
${_SWRAP_TEST}
PROPERTY
ENVIRONMENT DYLD_FORCE_FLAT_NAMESPACE=1;DYLD_INSERT_LIBRARIES=${CMAKE_BINARY_DIR}/src/libsocket_wrapper.dylib)
else ()
set_property(
TEST
${_SWRAP_TEST}
PROPERTY
ENVIRONMENT LD_PRELOAD=${CMAKE_BINARY_DIR}/src/libsocket_wrapper.so)
endif()
endforeach() | 1 | 0.027027 | 1 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.