redminerb 0.2.0 → 0.2.1

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: 06151d01eec527cbe1bd4ffaae591261853927c5
4
- data.tar.gz: aba32467e103b17ee396e9971ad962ee509420ce
3
+ metadata.gz: a49e586712bf0924ff9b33e62ced033b819f04c9
4
+ data.tar.gz: 701469b08e46198247d08f594a408adf2d337bfc
5
5
  SHA512:
6
- metadata.gz: aefb44e25b2fcd44cf66bb8bd369fb0e096b1a788b6379916fbbc6d0d6031a8f0177e0337796e1463277eea016057f1fc79b097999f7ad0e5817b1da0a9103fb
7
- data.tar.gz: 6e1b9acab0953a026a0f88614b016c4fe69239845a6d449ee05f1485025af4254c57ca1850723318d49f6b6e1cddb04a26f0502e7a8d8d58c0b71275397f791a
6
+ metadata.gz: 748833ecb5650f32b39bd15701a8b8920cec019dae74cbf9cfadaad204d42fee75a5c388f3cf1c230b2f86c0cea6ec11ce3fb0e2735139525554261ea2201487
7
+ data.tar.gz: 7b332454c69db01165a560f4bf83d04a099fd8293e142d8b605483de73bd33087acf4257a3104db64415e9bae90ee8dc68234c5fab3190b0e2b9c5f8b5806086
data/CHANGELOG.rdoc CHANGED
@@ -6,6 +6,3 @@
6
6
 
7
7
  * 'redminerb config' to get current config
8
8
  * 'redminerb users [list]' to see current users
9
-
10
- * 'redminerb config' to get current config
11
- * 'redminerb users [list]' to see current users
data/README.md CHANGED
@@ -34,12 +34,19 @@ Or install it yourself as:
34
34
 
35
35
  ## Usage
36
36
 
37
- The URL of your Redmine server and your API key needs to be in your
38
- `~/.redminerb.yml` in order to connect to its REST API. For example:
37
+ The URL and the API key needed to access to your Redmine REST API need to be in
38
+ in your environment or in the `~/.redminerb.yml`.
39
+
40
+ For example, this `~/.redminerb.yml`:
39
41
 
40
42
  url: http://localhost:3000/
41
43
  api_key: 69b47d74e36a6757bac5d45f8398dd23bfa8f52c
42
44
 
45
+ Would be the same as having the following in your `.bashrc`:
46
+
47
+ export REDMINERB_URL=http://localhost:3000/
48
+ export REDMINERB_API_KEY=69b47d74e36a6757bac5d45f8398dd23bfa8f52c
49
+
43
50
  ### Configuration (config)
44
51
 
45
52
  To see the current configuration used by Redminerb we have the `config` command:
@@ -75,5 +82,5 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
75
82
 
76
83
  ## Contributing
77
84
 
78
- Bug reports and pull requests are welcome on GitHub at https://github.com/nando/redminerb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
85
+ Bug reports and pull requests are welcome on GitHub at https://github.com/nando/redminerb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
79
86
 
@@ -5,10 +5,7 @@ module Redminerb
5
5
  # Read user's config from ~/.redminerb.yml
6
6
  class Config
7
7
  def initialize
8
- YAML.load_file(File.join(ENV['HOME'], '.redminerb.yml')).tap do |yaml|
9
- @url = yaml['url']
10
- @api_key = yaml['api_key']
11
- end
8
+ ENV['REDMINERB_URL'] ? _from_env : _from_yml
12
9
  end
13
10
 
14
11
  def url
@@ -20,5 +17,19 @@ module Redminerb
20
17
  Redminerb.init_required!
21
18
  @api_key
22
19
  end
20
+
21
+ private
22
+
23
+ def _from_yml
24
+ YAML.load_file(File.join(ENV['HOME'], '.redminerb.yml')).tap do |yaml|
25
+ @url = yaml['url']
26
+ @api_key = yaml['api_key']
27
+ end
28
+ end
29
+
30
+ def _from_env
31
+ @url = ENV['REDMINERB_URL']
32
+ @api_key = ENV['REDMINERB_API_KEY']
33
+ end
23
34
  end
24
35
  end
@@ -1,4 +1,4 @@
1
1
  # Copyright (c) The Cocktail Experience S.L. (2015)
2
2
  module Redminerb
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  end
data/redminerb.gemspec CHANGED
@@ -36,7 +36,11 @@ Gem::Specification.new do |spec|
36
36
 
37
37
  spec.add_development_dependency 'bundler', '~> 1.10'
38
38
  spec.add_development_dependency 'rake', '~> 10.0'
39
+
39
40
  spec.add_development_dependency 'minitest'
41
+ spec.add_development_dependency 'climate_control' # fake ENV
42
+
40
43
  spec.add_development_dependency 'rubocop'
44
+
41
45
  spec.add_development_dependency 'pry'
42
46
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redminerb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fernando Garcia Samblas
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-17 00:00:00.000000000 Z
11
+ date: 2015-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: climate_control
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: rubocop
99
113
  requirement: !ruby/object:Gem::Requirement