exvo_helpers 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +65 -0
- data/exvo_helpers.gemspec +19 -19
- data/lib/exvo_helpers/helpers.rb +7 -2
- data/lib/exvo_helpers/version.rb +1 -1
- data/spec/exvo_helpers/helpers_spec.rb +26 -1
- metadata +20 -19
data/CHANGELOG.md
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
# CHANGELOG
|
2
|
+
|
3
|
+
Note, that only significant changes are listed.
|
4
|
+
|
5
|
+
## 0.2.1 (2012-01-27)
|
6
|
+
|
7
|
+
* Bugfix (`ENV["AUTH_REQUIRE_SSL"]` and `ENV["AUTH_DEBUG"]` were not being respected when set to `false`)
|
8
|
+
|
9
|
+
|
10
|
+
## 0.2.0 (2012-01-20)
|
11
|
+
|
12
|
+
* **all** auth configuration is now at `Exvo::Helpers.auth_*` methods (`auth_client_id`, `auth_client_secret`, `auth_debug`, `auth_require_ssl`)
|
13
|
+
|
14
|
+
|
15
|
+
## 0.1.1 (2012-01-15)
|
16
|
+
|
17
|
+
* if Rails/Merb are undefined it will fall back to `'production'` for `@@env` (useful for specs in other gems depending on this)
|
18
|
+
|
19
|
+
|
20
|
+
## 0.1.0 (2012-01-13)
|
21
|
+
|
22
|
+
* `Exvo::Helpers.auth_host` and `Exvo::Helpers.auth_uri` are defined in here now (instead of falling back to the `exvo-auth` gem)
|
23
|
+
|
24
|
+
|
25
|
+
## 0.0.8 (2011-12-13)
|
26
|
+
|
27
|
+
* protocol agnostic URIs to cdn/cfs/themes (i.e. starting with '//')
|
28
|
+
* CDN host is now `*.cloudfront.net` for production/staging (so that it has proper SSL certificate)
|
29
|
+
|
30
|
+
|
31
|
+
## 0.0.7 (2011-12-08)
|
32
|
+
|
33
|
+
* host/uri helpers for preview app
|
34
|
+
|
35
|
+
|
36
|
+
## 0.0.6 (2011-11-24)
|
37
|
+
|
38
|
+
* Rails view helpers: `themes_image_tag` and `themes_stylesheet_link_tag`
|
39
|
+
|
40
|
+
|
41
|
+
## 0.0.5 (2011-11-23)
|
42
|
+
|
43
|
+
* Bugfix (temporarily force http for cdn bundles)
|
44
|
+
|
45
|
+
|
46
|
+
## 0.0.4 (2011-11-22)
|
47
|
+
|
48
|
+
* host/uri helpers for blog/contacts/inbox/music/pics
|
49
|
+
|
50
|
+
|
51
|
+
## 0.0.3 (2011-11-18)
|
52
|
+
|
53
|
+
* Rails view helpers: `javascript_bundle_include_tag`
|
54
|
+
* host/uri helpers for cdn
|
55
|
+
|
56
|
+
|
57
|
+
## 0.0.2 (2011-10-27)
|
58
|
+
|
59
|
+
* Refactoring
|
60
|
+
|
61
|
+
|
62
|
+
## 0.0.1 (2011-10-25)
|
63
|
+
|
64
|
+
* host/uri helpers for auth, which just pass to the `exvo-auth` gem
|
65
|
+
* host/uri helpers for cfs/desktop/themes
|
data/exvo_helpers.gemspec
CHANGED
@@ -2,25 +2,25 @@
|
|
2
2
|
$:.push File.expand_path("../lib", __FILE__)
|
3
3
|
require "exvo_helpers/version"
|
4
4
|
|
5
|
-
Gem::Specification.new do |
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
Gem::Specification.new do |gem|
|
6
|
+
gem.name = "exvo_helpers"
|
7
|
+
gem.version = ExvoHelpers::VERSION
|
8
|
+
gem.authors = ["Paweł Gościcki"]
|
9
|
+
gem.email = ["pawel.goscicki@gmail.com"]
|
10
|
+
gem.homepage = "https://github.com/Exvo/exvo_helpers/"
|
11
|
+
gem.summary = %q{Collection of helper methods for various Exvo related apps/services}
|
12
|
+
gem.description = %q{Ruby gem providing various helper methods, like auth_host, auth_uri, auth_require_ssl, cdn_host, etc.}
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
gem.files = `git ls-files`.split("\n")
|
15
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
|
+
gem.require_paths = ["lib"]
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
19
|
+
gem.add_development_dependency 'rspec', ['>= 2.8']
|
20
|
+
gem.add_development_dependency 'guard', ['>= 0.10.0']
|
21
|
+
gem.add_development_dependency 'guard-rspec', ['>= 0.6.0']
|
22
|
+
gem.add_development_dependency "rb-fsevent"
|
23
|
+
gem.add_development_dependency "rb-inotify"
|
24
|
+
gem.add_development_dependency "simplecov"
|
25
|
+
gem.add_development_dependency "simplecov-rcov"
|
26
26
|
end
|
data/lib/exvo_helpers/helpers.rb
CHANGED
@@ -60,13 +60,18 @@ module Exvo
|
|
60
60
|
|
61
61
|
# def self.auth_debug
|
62
62
|
# return @@auth_debug if defined?(@@auth_debug) && !@@auth_debug.nil?
|
63
|
-
#
|
63
|
+
# value = true if ENV["AUTH_DEBUG"] =~ /true/i
|
64
|
+
# value = false if ENV["AUTH_DEBUG"] =~ /false/i
|
65
|
+
# value = default_opts[env.to_sym]["auth_debug".to_sym] if value.nil?
|
66
|
+
# @@auth_debug = value
|
64
67
|
# end
|
65
68
|
define_method "auth_#{option}" do
|
66
69
|
if class_variable_defined?("@@auth_#{option}") and !class_variable_get("@@auth_#{option}").nil?
|
67
70
|
class_variable_get("@@auth_#{option}")
|
68
71
|
else
|
69
|
-
value =
|
72
|
+
value = true if ENV["AUTH_#{option.upcase}"] =~ /true/i
|
73
|
+
value = false if ENV["AUTH_#{option.upcase}"] =~ /false/i
|
74
|
+
value = default_opts[env.to_sym]["auth_#{option}".to_sym] if value.nil?
|
70
75
|
class_variable_set("@@auth_#{option}", value)
|
71
76
|
end
|
72
77
|
end
|
data/lib/exvo_helpers/version.rb
CHANGED
@@ -52,9 +52,22 @@ describe Exvo::Helpers do
|
|
52
52
|
specify { Exvo::Helpers.preview_host.should eql('preview.exvo.com') }
|
53
53
|
end
|
54
54
|
|
55
|
-
describe "#auth_debug
|
55
|
+
describe "#auth_debug by default for production env" do
|
56
56
|
specify { Exvo::Helpers.auth_debug.should be_false }
|
57
|
+
|
58
|
+
after do
|
59
|
+
# reset cached class instance variable
|
60
|
+
Exvo::Helpers.auth_debug = nil
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
describe "#auth_require_ssl by default for production env" do
|
57
65
|
specify { Exvo::Helpers.auth_require_ssl.should be_true }
|
66
|
+
|
67
|
+
after do
|
68
|
+
# reset cached class instance variable
|
69
|
+
Exvo::Helpers.auth_require_ssl = nil
|
70
|
+
end
|
58
71
|
end
|
59
72
|
|
60
73
|
describe "setting #auth_client_id and #auth_client_secret via ENV variables" do
|
@@ -106,6 +119,18 @@ describe Exvo::Helpers do
|
|
106
119
|
end
|
107
120
|
end
|
108
121
|
|
122
|
+
describe "setting the auth_require_ssl to false via ENV variable overrides the default" do
|
123
|
+
before do
|
124
|
+
ENV["AUTH_REQUIRE_SSL"] = 'false'
|
125
|
+
end
|
126
|
+
|
127
|
+
specify { Exvo::Helpers.auth_uri.should match(/http:\/\//) }
|
128
|
+
|
129
|
+
after do
|
130
|
+
ENV["AUTH_REQUIRE_SSL"] = nil
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
109
134
|
describe "setting the auth_require_ssl directly overrides the default" do
|
110
135
|
before do
|
111
136
|
Exvo::Helpers.auth_require_ssl = false
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exvo_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-01-
|
12
|
+
date: 2012-01-27 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &83264590 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '2.8'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *83264590
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: guard
|
27
|
-
requirement: &
|
27
|
+
requirement: &83264220 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.10.0
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *83264220
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: guard-rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &83263770 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 0.6.0
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *83263770
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rb-fsevent
|
49
|
-
requirement: &
|
49
|
+
requirement: &83263450 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *83263450
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rb-inotify
|
60
|
-
requirement: &
|
60
|
+
requirement: &83263090 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *83263090
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: simplecov
|
71
|
-
requirement: &
|
71
|
+
requirement: &83262810 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *83262810
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: simplecov-rcov
|
82
|
-
requirement: &
|
82
|
+
requirement: &83262530 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,9 +87,9 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
91
|
-
description: Ruby gem providing helper
|
92
|
-
|
90
|
+
version_requirements: *83262530
|
91
|
+
description: Ruby gem providing various helper methods, like auth_host, auth_uri,
|
92
|
+
auth_require_ssl, cdn_host, etc.
|
93
93
|
email:
|
94
94
|
- pawel.goscicki@gmail.com
|
95
95
|
executables: []
|
@@ -97,6 +97,7 @@ extensions: []
|
|
97
97
|
extra_rdoc_files: []
|
98
98
|
files:
|
99
99
|
- .gitignore
|
100
|
+
- CHANGELOG.md
|
100
101
|
- Gemfile
|
101
102
|
- MIT-LICENSE
|
102
103
|
- README.md
|
@@ -133,6 +134,6 @@ rubyforge_project:
|
|
133
134
|
rubygems_version: 1.8.10
|
134
135
|
signing_key:
|
135
136
|
specification_version: 3
|
136
|
-
summary:
|
137
|
+
summary: Collection of helper methods for various Exvo related apps/services
|
137
138
|
test_files: []
|
138
139
|
has_rdoc:
|