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 +4 -4
- data/.travis.yml +7 -0
- data/CONTRIBUTING.md +5 -0
- data/changelog.md +12 -0
- data/lib/env_branch/base.rb +24 -0
- data/lib/env_branch/test_helper.rb +14 -0
- data/lib/env_branch/version.rb +1 -1
- data/lib/env_branch.rb +4 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cd9e054ab26c91fa9e0c6b6070acbf4ac742642
|
4
|
+
data.tar.gz: 2c09bdc9edafd871436cd8c91529c102445bd6af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
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
|
data/lib/env_branch/version.rb
CHANGED
data/lib/env_branch.rb
CHANGED
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
|
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-
|
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
|