exvo_helpers 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Ruby gem providing helper methods for various Exvo apps/services. It takes into account the Rails.env (or Merb.env). Also allows overwriting of the defaults by ENV variables (and directly too, see below).
4
4
 
5
- ## Examples
5
+ ## Helpers
6
6
 
7
7
  Results are from the 'development' Rails environment:
8
8
 
@@ -36,7 +36,7 @@ Exvo::Helpers.auth_uri => 'http://exvo.auth.local'
36
36
  ```
37
37
 
38
38
 
39
- ## Overwriting
39
+ ### Overwriting
40
40
 
41
41
  There are two ways to do it. One is by the means of ENV variables (preferred one):
42
42
 
@@ -67,5 +67,29 @@ Exvo::Helpers.pics_host = 'test.pics.exvo.local'
67
67
  ```
68
68
 
69
69
 
70
+ ## View helpers
71
+
72
+ There is a `javascript_bundle_include_tag` view helper function, which includes a different Desktop JS bundles depending on current environment.
73
+
74
+ The following declaraions:
75
+
76
+ ```ruby
77
+ = javascript_bundle_include_tag("plugins")
78
+ = javascript_bundle_include_tag("utils")
79
+ = javascript_bundle_include_tag("widgets")
80
+ = javascript_bundle_include_tag("dock")
81
+ = javascript_bundle_include_tag("uploader")
82
+ ```
83
+
84
+ will output this for the 'development' environment:
85
+
86
+ ```html
87
+ <script src="http://www.exvo.local/javascripts/bundles/plugins.js" type="text/javascript"></script>
88
+ <script src="http://www.exvo.local/javascripts/bundles/utils.js" type="text/javascript"></script>
89
+ <script src="http://www.exvo.local/javascripts/bundles/widgets.js" type="text/javascript"></script>
90
+ <script src="http://www.exvo.local/javascripts/bundles/dock.js" type="text/javascript"></script>
91
+ <script src="http://www.exvo.local/javascripts/bundles/uploader.js" type="text/javascript"></script>
92
+ ```
93
+
70
94
 
71
95
  Copyright © 2011 Exvo.com Development BV
@@ -1,3 +1,3 @@
1
1
  module ExvoHelpers
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -2,11 +2,12 @@ module Exvo
2
2
 
3
3
  module ViewHelpers
4
4
 
5
- # special link starting with '//' in production so that the webserver can choose between HTTP and HTTPS
6
5
  def javascript_bundle_include_tag(bundle)
7
6
  case Exvo::Helpers.env.to_sym
8
7
  when :production
9
- javascript_include_tag "//#{ Exvo::Helpers.cdn_host }/javascripts/#{bundle}.js"
8
+ # FIXME change back to '//' in production so that the webserver can choose between HTTP and HTTPS
9
+ # note, that it requires a proper SSL certificate installed for cdn.exvo.com domain
10
+ javascript_include_tag "http://#{ Exvo::Helpers.cdn_host }/javascripts/#{bundle}.js"
10
11
  when :staging
11
12
  javascript_include_tag "http://#{ Exvo::Helpers.cdn_host }/javascripts/#{bundle}.js"
12
13
  else
@@ -12,7 +12,7 @@ describe Exvo::ViewHelpers do
12
12
 
13
13
  it "should return the javascript_include_tag based on env" do
14
14
  Exvo::Helpers.stub(:env).and_return('production')
15
- view_helper.should_receive(:javascript_include_tag).with("//cdn.exvo.com/javascripts/plugins.js")
15
+ view_helper.should_receive(:javascript_include_tag).with("http://cdn.exvo.com/javascripts/plugins.js")
16
16
  view_helper.javascript_bundle_include_tag("plugins")
17
17
  end
18
18
  end
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.0.4
4
+ version: 0.0.5
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: 2011-11-22 00:00:00.000000000Z
12
+ date: 2011-11-23 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &85101570 !ruby/object:Gem::Requirement
16
+ requirement: &72666460 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *85101570
24
+ version_requirements: *72666460
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &85101310 !ruby/object:Gem::Requirement
27
+ requirement: &72666170 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '2.7'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *85101310
35
+ version_requirements: *72666170
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: guard
38
- requirement: &85101070 !ruby/object:Gem::Requirement
38
+ requirement: &72665880 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.8.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *85101070
46
+ version_requirements: *72665880
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: guard-rspec
49
- requirement: &85100830 !ruby/object:Gem::Requirement
49
+ requirement: &72665590 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.4.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *85100830
57
+ version_requirements: *72665590
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rb-fsevent
60
- requirement: &85100640 !ruby/object:Gem::Requirement
60
+ requirement: &72665290 !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: *85100640
68
+ version_requirements: *72665290
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rb-inotify
71
- requirement: &85100410 !ruby/object:Gem::Requirement
71
+ requirement: &72664900 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *85100410
79
+ version_requirements: *72664900
80
80
  description: Ruby gem providing helper *_uri/*_host methods for Exvo services/apps
81
81
  like DESKTOP/CFS/AUTH/THEMES.
82
82
  email: