env_branch 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4058b3d53fa644c1bcb92445ec4b36e399e1e81b
4
- data.tar.gz: 51553be2677fd4ab107c0bcdb5898ff1f33a3b46
3
+ metadata.gz: 46629e008ce472695be6afcb51446ef1d378d141
4
+ data.tar.gz: e2336cced6797fb7a33cb8cdb39f18931026607b
5
5
  SHA512:
6
- metadata.gz: a9bc77f5838ab92d6ff7172587b5aaedf5e304a4a9f3062f7aa7aad4cef6f7e43347dd116254c50a366ada75288f624418b070ec64046e533f83a96d01d60a05
7
- data.tar.gz: 70703f2a07317362253dc88d26b1de3160354e38806dd8428db391b4c6f65460ef5cbb836b9b46f99dffd46268d03409812eeeb5358d4fde2292abd1a42e1f32
6
+ metadata.gz: 681644597ab6907f9a136f6d642449492c04ac2b1437cc35ba9f835ae83d94baad50021d0292a9c5f4cc85feb255f17dbae54cbbac3364dd03cdd13545a569f8
7
+ data.tar.gz: bf528d8a98eeb72fd8bbe83e15cd8fd0e1bad3e73edfbb80b016259d08bdc3e8453025693ba38d1325a3233efb8c9ffd0e8f1a7b7253a6db2eaf7ab00ddfc079
data/CODE_OF_CONDUCT.md CHANGED
File without changes
data/CONTRIBUTING.md CHANGED
File without changes
data/Gemfile CHANGED
File without changes
data/LICENSE.txt CHANGED
File without changes
data/README.md CHANGED
@@ -70,6 +70,11 @@ And more *[details][docs-url]*.
70
70
  * [Environment variables - CircleCI](https://circleci.com/docs/environment-variables#build-details)
71
71
 
72
72
 
73
+ ## Related
74
+
75
+ * [env_pull_request](https://github.com/packsaddle/ruby-env_pull_request)
76
+
77
+
73
78
  ## Changelog
74
79
 
75
80
  [changelog.md](./changelog.md).
data/Rakefile CHANGED
@@ -10,8 +10,8 @@ task default: :test
10
10
 
11
11
  require 'yard'
12
12
  require 'yard/rake/yardoc_task'
13
- DOC_FILES = ['lib/**/*.rb']
14
- DOC_OPTIONS = ['--debug', '--verbose']
13
+ DOC_FILES = ['lib/**/*.rb'].freeze
14
+ DOC_OPTIONS = ['--debug', '--verbose'].freeze
15
15
  YARD::Rake::YardocTask.new(:doc) do |t|
16
16
  t.files = DOC_FILES
17
17
  t.options = DOC_OPTIONS if Rake.application.options.trace
data/changelog.md CHANGED
@@ -1,3 +1,9 @@
1
+ <a name="0.2.2"></a>
2
+ ## [0.2.2](https://github.com/packsaddle/ruby-env_branch/compare/v0.2.1...v0.2.2) (2016-05-01)
3
+
4
+ * Remove warning about instance variable.
5
+
6
+
1
7
  <a name="0.2.1"></a>
2
8
  ## [0.2.1](https://github.com/packsaddle/ruby-env_branch/compare/v0.2.0...v0.2.1) (2015-09-28)
3
9
 
data/env_branch.gemspec CHANGED
@@ -18,13 +18,14 @@ Gem::Specification.new do |spec|
18
18
 
19
19
  spec.files =
20
20
  `git ls-files -z`
21
- .split("\x0")
22
- .reject { |f| f.match(%r{^(test|spec|features)/}) }
21
+ .split("\x0")
22
+ .reject { |f| f.match(%r{^(test|spec|features)/}) }
23
+ .reject { |f| f.match(/^\.|package\.json/) }
23
24
  spec.bindir = 'exe'
24
25
  spec.executables =
25
26
  spec
26
- .files
27
- .grep(%r{^exe/}) { |f| File.basename(f) }
27
+ .files
28
+ .grep(%r{^exe/}) { |f| File.basename(f) }
28
29
  spec.require_paths = ['lib']
29
30
 
30
31
  spec.add_development_dependency 'bundler'
data/example/Gemfile CHANGED
File without changes
data/example/Gemfile.lock CHANGED
File without changes
data/lib/env_branch.rb CHANGED
File without changes
@@ -25,10 +25,10 @@ module EnvBranch
25
25
  #
26
26
  # @yield user defined block
27
27
  # @return [Base] Branch information object
28
- def initialize(&block)
28
+ def initialize
29
29
  @branch_name =
30
30
  if block_given?
31
- block.call || fetch_branch_name
31
+ yield || fetch_branch_name
32
32
  else
33
33
  fetch_branch_name
34
34
  end
@@ -44,8 +44,10 @@ module EnvBranch
44
44
  #
45
45
  # @see Base#fetch_branch_name
46
46
  def restore_env_branch
47
- ENV['TRAVIS_BRANCH'] = @original_travis_branch
48
- ENV['CIRCLE_BRANCH'] = @original_circle_branch
47
+ original_travis_branch = (defined?(@original_travis_branch) && @original_travis_branch) || nil
48
+ original_circle_branch = (defined?(@original_circle_branch) && @original_circle_branch) || nil
49
+ ENV['TRAVIS_BRANCH'] = original_travis_branch
50
+ ENV['CIRCLE_BRANCH'] = original_circle_branch
49
51
  end
50
52
  end
51
53
  end
@@ -1,3 +1,3 @@
1
1
  module EnvBranch
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: env_branch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - sanemat
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-28 00:00:00.000000000 Z
11
+ date: 2016-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -59,10 +59,6 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
- - ".conventional-changelog.context.js"
63
- - ".gitignore"
64
- - ".rubocop.yml"
65
- - ".travis.yml"
66
62
  - CODE_OF_CONDUCT.md
67
63
  - CONTRIBUTING.md
68
64
  - Gemfile
@@ -80,7 +76,6 @@ files:
80
76
  - lib/env_branch/base.rb
81
77
  - lib/env_branch/test_helper.rb
82
78
  - lib/env_branch/version.rb
83
- - package.json
84
79
  homepage: https://github.com/packsaddle/ruby-env_branch
85
80
  licenses:
86
81
  - MIT
@@ -101,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
96
  version: '0'
102
97
  requirements: []
103
98
  rubyforge_project:
104
- rubygems_version: 2.4.5
99
+ rubygems_version: 2.5.1
105
100
  signing_key:
106
101
  specification_version: 4
107
102
  summary: Get BRANCH_NAME from environment variables.
@@ -1,17 +0,0 @@
1
- 'use strict';
2
- var execSync = require('child_process').execSync;
3
- var URI = require('urijs');
4
-
5
- var gemspec = JSON.parse(execSync('bundle exec parse-gemspec-cli env_branch.gemspec'));
6
- var homepageUrl = gemspec.homepage;
7
- var url = new URI(homepageUrl);
8
- var host = url.protocol() + '://' + url.authority();
9
- var owner = url.pathname().split('/')[1];
10
- var repository = url.pathname().split('/')[2];
11
-
12
- module.exports = {
13
- version: gemspec.version,
14
- host: host,
15
- owner: owner,
16
- repository: repository
17
- };
data/.gitignore DELETED
@@ -1,12 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
- /node_modules/
11
- /example/.bundle/
12
- /example/vendor/bundle/
data/.rubocop.yml DELETED
@@ -1,10 +0,0 @@
1
- AllCops:
2
- Exclude:
3
- - vendor/bundle/**/*
4
- - example/vendor/bundle/**/*
5
- Style/Documentation:
6
- Enabled: false
7
- Style/FileName:
8
- Exclude:
9
- - bin/*
10
- - exe/*
data/.travis.yml DELETED
@@ -1,20 +0,0 @@
1
- # CAUTION: DO NOT ADD encrypted value!
2
- # test/test_test_helper.rb asserts ENV.
3
- # And this will show ENV accidentally in CI log.
4
- language: "ruby"
5
- rvm:
6
- - "1.9"
7
- - "2.0"
8
- - "2.1"
9
- - "2.2"
10
- - "ruby-head"
11
- matrix:
12
- allow_failures:
13
- - rvm: "ruby-head"
14
- before_install:
15
- - "gem update bundler"
16
- - "bin/setup"
17
- before_script:
18
- - "printenv"
19
- after_script:
20
- - "printenv"
data/package.json DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "devDependencies": {
3
- "conventional-changelog": "0.4.3",
4
- "npm-check-updates": "^2.2.3",
5
- "urijs": "^1.16.1"
6
- },
7
- "scripts": {
8
- "changelog": "conventional-changelog -i changelog.md --overwrite --preset angular --context .conventional-changelog.context.js",
9
- "ncu": "ncu -u"
10
- }
11
- }