env_branch 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 461e23daf4a9bd5f64e1eb4097865a29e1e38406
4
- data.tar.gz: 719dfac8eeecf2f72dba3807021de04325a6ba13
3
+ metadata.gz: 8cd9e054ab26c91fa9e0c6b6070acbf4ac742642
4
+ data.tar.gz: 2c09bdc9edafd871436cd8c91529c102445bd6af
5
5
  SHA512:
6
- metadata.gz: 1c48066efe94fdb06a4e036e24b41d4023ceee5805e94a3a75e91b29dd578ce3008075fa7ab44b993854d0a76c44993d0c80979df589673cdc78cf515a7cae5f
7
- data.tar.gz: 39e816d39809b764d6c1f0b9b38dfe6aabd88e019d024e6847d3d1ef4bdd21fd5d5779d5ab7b7cc3ffb965eb738da52c3ea0337c0494ec96b37423540a0f883d
6
+ metadata.gz: 5461c82b26a2df8ddf42a05f808d212fd693d005de9f58aae836f4c75a3f5db94287564cbe153d5bc7a9c7f1adce17ce0a90c608d55de5b53a3ac024a29df47a
7
+ data.tar.gz: e926c08d1094b484623889542135989f77fefdf518e53431267e62fb0bdec78322adfd0395466fd66b25d9225b32d952daa29fc114e387d9e89a761cc9e8c6df
data/.travis.yml CHANGED
@@ -1,3 +1,6 @@
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.
1
4
  language: "ruby"
2
5
  rvm:
3
6
  - "1.9"
@@ -11,3 +14,7 @@ matrix:
11
14
  before_install:
12
15
  - "gem update bundler"
13
16
  - "bin/setup"
17
+ before_script:
18
+ - "printenv"
19
+ after_script:
20
+ - "printenv"
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,5 @@
1
+ # NOTE
2
+
3
+ DO NOT ADD encrypted value to environment variable on this repository!
4
+ `test/test_test_helper.rb` asserts `ENV`.
5
+ And this will show `ENV` accidentally in CI log.
data/changelog.md CHANGED
@@ -1,3 +1,15 @@
1
+ <a name="0.1.0"></a>
2
+ # [0.1.0](https://github.com/packsaddle/ruby-env_branch/compare/v0.0.1...v0.1.0) (2015-09-28)
3
+
4
+
5
+ ### Features
6
+
7
+ * **branch:** add not branch ([d5be3cd](https://github.com/packsaddle/ruby-env_branch/commit/d5be3cd))
8
+ * **fetch:** add travis ([24cd870](https://github.com/packsaddle/ruby-env_branch/commit/24cd870))
9
+ * **helper:** add test helper ([d347d9f](https://github.com/packsaddle/ruby-env_branch/commit/d347d9f))
10
+
11
+
12
+
1
13
  <a name="0.0.1"></a>
2
14
  ## 0.0.1 (2015-09-27)
3
15
 
@@ -0,0 +1,24 @@
1
+ module EnvBranch
2
+ class Base
3
+ attr_reader :branch_name
4
+
5
+ def initialize
6
+ @branch_name = fetch_branch_name
7
+ end
8
+
9
+ # travis-ci.org:
10
+ # ENV['TRAVIS_BRANCH']
11
+ #
12
+ # @see http://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables
13
+ # Environment Variables - Travis CI
14
+ def fetch_branch_name
15
+ if ENV['TRAVIS_BRANCH'] && !ENV['TRAVIS_BRANCH'].empty?
16
+ ENV['TRAVIS_BRANCH']
17
+ end
18
+ end
19
+
20
+ def branch?
21
+ !branch_name.nil?
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,14 @@
1
+ module EnvBranch
2
+ module TestHelper
3
+ module_function
4
+
5
+ def stash_env_branch
6
+ @original_travis_branch = ENV['TRAVIS_BRANCH']
7
+ ENV.delete 'TRAVIS_BRANCH'
8
+ end
9
+
10
+ def restore_env_branch
11
+ ENV['TRAVIS_BRANCH'] = @original_travis_branch
12
+ end
13
+ end
14
+ end
@@ -1,3 +1,3 @@
1
1
  module EnvBranch
2
- VERSION = '0.0.1'
2
+ VERSION = '0.1.0'
3
3
  end
data/lib/env_branch.rb CHANGED
@@ -1,5 +1,8 @@
1
+ require 'env_branch/base'
1
2
  require 'env_branch/version'
2
3
 
3
4
  module EnvBranch
4
- # Your code goes here...
5
+ def self.new
6
+ Base.new
7
+ end
5
8
  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.0.1
4
+ version: 0.1.0
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-27 00:00:00.000000000 Z
11
+ date: 2015-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -64,6 +64,7 @@ files:
64
64
  - ".rubocop.yml"
65
65
  - ".travis.yml"
66
66
  - CODE_OF_CONDUCT.md
67
+ - CONTRIBUTING.md
67
68
  - Gemfile
68
69
  - LICENSE.txt
69
70
  - README.md
@@ -76,6 +77,8 @@ files:
76
77
  - example/Gemfile.lock
77
78
  - example/setup.rb
78
79
  - lib/env_branch.rb
80
+ - lib/env_branch/base.rb
81
+ - lib/env_branch/test_helper.rb
79
82
  - lib/env_branch/version.rb
80
83
  - package.json
81
84
  homepage: https://github.com/packsaddle/ruby-env_branch