addons 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/addons/config.rb +10 -6
- data/lib/addons/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34d47952c09b18520a6a613dd4f73f73548f924d
|
4
|
+
data.tar.gz: 91f7fd89e92b1eb2c77e70106cc4911dbf944af2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9130ec44b10b49d157ef9137ebd3bb62a3eb20b7a07d8938c802e7cc3d5d7d8ef246152a2f33ac3ff1ac30cebbcdcc38e9d0c0d1e16f4278c1c568779a667fda
|
7
|
+
data.tar.gz: bb1412197ba4e31355364b844fb351367c4176561fef8523db7b24f467148ead25e62ecdcaae36acbdce98458a4c1872b42938c80ab6881c117f76def7cafa05
|
data/README.md
CHANGED
@@ -27,3 +27,6 @@ TODO: Write usage instructions here
|
|
27
27
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
28
|
4. Push to the branch (`git push origin my-new-feature`)
|
29
29
|
5. Create new Pull Request
|
30
|
+
|
31
|
+
|
32
|
+
<a href="https://github.com/addonlist/addons-gem-test" target="_blank">Test App repo</a>
|
data/lib/addons/config.rb
CHANGED
@@ -12,14 +12,16 @@ module Addons
|
|
12
12
|
if ENV['ADDONS_APP_ID'].nil? or ENV['ADDONS_APP_ID'] == ""
|
13
13
|
filename = Rails.root.join('config', 'application.yml')
|
14
14
|
|
15
|
-
File.
|
16
|
-
|
15
|
+
if File.exists?(filename)
|
16
|
+
File.open(filename, 'r') do |file|
|
17
|
+
# NOTE: read the ADDONS_APP_ID and ADDONS_APP_TOKEN from application.yml and set ENV vars.
|
17
18
|
|
18
|
-
|
19
|
-
|
19
|
+
file.each_line do |line|
|
20
|
+
matches = line.match(/(.*): (.*)/)
|
20
21
|
|
21
|
-
|
22
|
-
|
22
|
+
env_var, value = matches[1], matches[2]
|
23
|
+
ENV[env_var] = value
|
24
|
+
end
|
23
25
|
end
|
24
26
|
end
|
25
27
|
end
|
@@ -27,8 +29,10 @@ module Addons
|
|
27
29
|
puts "checking ENV['ADDONS_APP_ID'] and ENV['ADDONS_APP_TOKEN']"
|
28
30
|
|
29
31
|
if ENV['ADDONS_APP_ID'] == nil
|
32
|
+
puts "Error: ENV['ADDONS_APP_ID'] must be defined"
|
30
33
|
return false, "Error: ENV['ADDONS_APP_ID'] must be defined"
|
31
34
|
elsif ENV['ADDONS_APP_TOKEN'] == nil
|
35
|
+
puts "Error: ENV['ADDONS_APP_TOKEN'] must be defined"
|
32
36
|
return false, "Error: ENV['ADDONS_APP_TOKEN'] must be defined"
|
33
37
|
end
|
34
38
|
|
data/lib/addons/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: addons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Addonlist
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|