rails_bridge 0.0.5 → 0.0.6
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/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/lib/rails_bridge/engine.rb +4 -4
- data/rails_bridge.gemspec +3 -1
- data/spec/dummy/app/rails_bridge/content_bridges/tester.rb +26 -0
- data/spec/integration/content_bridge_spec.rb +1 -0
- metadata +5 -3
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
data/lib/rails_bridge/engine.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
module RailsBridge
|
2
2
|
ROOT_PATH = 'app/rails_bridge'
|
3
|
+
CONTENT_BRIDGES_PATH = File.join( ROOT_PATH, 'content_bridges' )
|
3
4
|
LAYOUTS_PATH = File.join(ROOT_PATH, 'layout_bridge', 'layouts')
|
4
5
|
VIEWS_PATH = File.join(ROOT_PATH, 'layout_bridge', 'views')
|
5
6
|
|
@@ -7,7 +8,8 @@ module RailsBridge
|
|
7
8
|
# to get our plugin into the initialization process
|
8
9
|
class Engine < Rails::Engine
|
9
10
|
|
10
|
-
|
11
|
+
config.autoload_paths << CONTENT_BRIDGES_PATH
|
12
|
+
|
11
13
|
# initialize our plugin on boot.
|
12
14
|
initializer "rails_bridge.initialize" do |app|
|
13
15
|
end
|
@@ -17,9 +19,7 @@ module RailsBridge
|
|
17
19
|
RailsBridge::ContentBridge.cache = Rails.cache
|
18
20
|
RailsBridge::Engine.create_rails_bridge_home
|
19
21
|
end
|
20
|
-
|
21
|
-
config.autoload_paths << ROOT_PATH
|
22
|
-
|
22
|
+
|
23
23
|
def self.create_rails_bridge_home
|
24
24
|
rails_bridge_home = File.join( Rails.root, RailsBridge::ROOT_PATH )
|
25
25
|
FileUtils.mkdir_p( rails_bridge_home ) unless File.exist?( rails_bridge_home )
|
data/rails_bridge.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{rails_bridge}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["shock"]
|
@@ -41,6 +41,7 @@ Gem::Specification.new do |s|
|
|
41
41
|
"spec/dummy/Rakefile",
|
42
42
|
"spec/dummy/app/controllers/application_controller.rb",
|
43
43
|
"spec/dummy/app/helpers/application_helper.rb",
|
44
|
+
"spec/dummy/app/rails_bridge/content_bridges/tester.rb",
|
44
45
|
"spec/dummy/app/rails_bridge/content_bridges/twitter_content_bridge.rb",
|
45
46
|
"spec/dummy/app/rails_bridge/layout_bridge/layouts/application/content.html.erb",
|
46
47
|
"spec/dummy/app/rails_bridge/layout_bridge/views/layouts/_partial.html.erb",
|
@@ -97,6 +98,7 @@ Gem::Specification.new do |s|
|
|
97
98
|
s.test_files = [
|
98
99
|
"spec/dummy/app/controllers/application_controller.rb",
|
99
100
|
"spec/dummy/app/helpers/application_helper.rb",
|
101
|
+
"spec/dummy/app/rails_bridge/content_bridges/tester.rb",
|
100
102
|
"spec/dummy/app/rails_bridge/content_bridges/twitter_content_bridge.rb",
|
101
103
|
"spec/dummy/autotest/discover.rb",
|
102
104
|
"spec/dummy/config/application.rb",
|
@@ -0,0 +1,26 @@
|
|
1
|
+
class Tester < RailsBridge::ContentBridge
|
2
|
+
# Uncomment the following options to create defaults to be used by all requests
|
3
|
+
# self.protocol = 'https' # defaults to 'http'
|
4
|
+
# self.host = 'example.com'
|
5
|
+
# self.port = 8080 # defaults to 80
|
6
|
+
# self.path = '/path/to/resource' # no default
|
7
|
+
# self.params = {:locale=>'en'} # no default
|
8
|
+
# self.default_content = "Content unavailable."
|
9
|
+
# self.on_success {|content| JSON.parse(content)}
|
10
|
+
# self.request_timeout = 1000 # miliseconds
|
11
|
+
# self.cache_timeout = 3600 # seconds
|
12
|
+
|
13
|
+
content_request :tester do |request|
|
14
|
+
# Uncomment the following options to override defaults set on the class.
|
15
|
+
# request.protocol = 'https'
|
16
|
+
# request.host = 'example.com'
|
17
|
+
# request.port = 8080
|
18
|
+
# request.path = '/path/to/resource'
|
19
|
+
# request.params = nil
|
20
|
+
# request.default_content = "Tester content unavailable."
|
21
|
+
# request.on_success nil
|
22
|
+
# request.request_timeout = 500 # miliseconds
|
23
|
+
# request.cache_timeout = 60 # seconds
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 6
|
9
|
+
version: 0.0.6
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- shock
|
@@ -268,6 +268,7 @@ files:
|
|
268
268
|
- spec/dummy/Rakefile
|
269
269
|
- spec/dummy/app/controllers/application_controller.rb
|
270
270
|
- spec/dummy/app/helpers/application_helper.rb
|
271
|
+
- spec/dummy/app/rails_bridge/content_bridges/tester.rb
|
271
272
|
- spec/dummy/app/rails_bridge/content_bridges/twitter_content_bridge.rb
|
272
273
|
- spec/dummy/app/rails_bridge/layout_bridge/layouts/application/content.html.erb
|
273
274
|
- spec/dummy/app/rails_bridge/layout_bridge/views/layouts/_partial.html.erb
|
@@ -330,7 +331,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
330
331
|
requirements:
|
331
332
|
- - ">="
|
332
333
|
- !ruby/object:Gem::Version
|
333
|
-
hash: -
|
334
|
+
hash: -3957783545554095629
|
334
335
|
segments:
|
335
336
|
- 0
|
336
337
|
version: "0"
|
@@ -352,6 +353,7 @@ summary: Bridges Rails with an external application.
|
|
352
353
|
test_files:
|
353
354
|
- spec/dummy/app/controllers/application_controller.rb
|
354
355
|
- spec/dummy/app/helpers/application_helper.rb
|
356
|
+
- spec/dummy/app/rails_bridge/content_bridges/tester.rb
|
355
357
|
- spec/dummy/app/rails_bridge/content_bridges/twitter_content_bridge.rb
|
356
358
|
- spec/dummy/autotest/discover.rb
|
357
359
|
- spec/dummy/config/application.rb
|