roda-component 0.1.69 → 0.1.70

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d8d49b296029ec3ba5ed63122b09cd267f29009c
4
- data.tar.gz: 16e8d558f42966772acc3539f1f5eabb9926700d
3
+ metadata.gz: 58ed9e592f03e28cf7ef8960f5ceacf6e54546a9
4
+ data.tar.gz: d92c150b2d3101268d2b4a3d45fc636c3bcf8e1c
5
5
  SHA512:
6
- metadata.gz: e2367171583e3554ad938b94229d5206cec708c6948b1643e582329de880d3ef7fb66d5ee9d5b4c2783e59b701f9c362d4e0bd7ed85fed14b33cb46b72c47dea
7
- data.tar.gz: aa4839f79fa4b9af37ecefceb7d2847f10daa1b0444a3fa41258403e262c1f2ac556fa266808c5c207331297a04365908344892d6ab9c06c70b780486ede5736
6
+ metadata.gz: 37a7e51565faba76cb95d9ec5d085579e4825a711ed26b3b43053488ccad39532a5ea0e6e977eaf3e42665eeba97813db7c5343db0efbf2de1fe7e9257639388
7
+ data.tar.gz: 1a2e9107a8f70b4bc0a9056ef74ac4d9575e921da9b17a30e3a30bf5c1bf5d66f22f95b01a7efbb17d4e579dd2e8b67fbe6aa33878c38d9417e75e1bfbe78f8e
@@ -24,7 +24,7 @@ class Roda
24
24
  def set_values(atts)
25
25
  @_attributes = []
26
26
 
27
- atts.each do |key, val|
27
+ (defined?(atts.attributes) ? atts.attributes : atts).each do |key, val|
28
28
  if respond_to?("#{key}=")
29
29
  send(:"#{key}=", val)
30
30
  @_attributes << key
@@ -95,7 +95,7 @@ class Roda
95
95
  @_attributes.set_attr_accessors _attr_accessors
96
96
  @_attributes.set_values _data
97
97
 
98
- _data.each do |key, val|
98
+ (defined?(_data.attributes) ? _data.attributes : _data).each do |key, val|
99
99
  send("#{key}=", val)
100
100
  end
101
101
 
@@ -1,78 +1,78 @@
1
1
  module Browser
2
2
 
3
- # Allows manipulation of a location, usually from {Window} and {DOM::Document}.
4
- #
5
- # @see https://developer.mozilla.org/en-US/docs/Web/API/Location
6
- class Location
7
- include Native
8
-
9
- # Change the location.
3
+ # Allows manipulation of a location, usually from {Window} and {DOM::Document}.
10
4
  #
11
- # @param url [String, #to_s] the URL to go to
12
- def assign(url)
13
- `#@native.assign(#{url.to_s})`
14
- end
5
+ # @see https://developer.mozilla.org/en-US/docs/Web/API/Location
6
+ class Location
7
+ include Native
15
8
 
16
- # Replace the current URL.
17
- #
18
- # @param url [String, #to_s] the URL to go to
19
- def replace(url)
20
- `#@native.replace(#{url.to_s})`
21
- end
9
+ # Change the location.
10
+ #
11
+ # @param url [String, #to_s] the URL to go to
12
+ def assign(url)
13
+ `#@native.assign(#{url.to_s})`
14
+ end
22
15
 
23
- # Reload the page.
24
- #
25
- # @param force [Boolean] whether to force the reload
26
- def reload(force = false)
27
- `#@native.reload(force)`
28
- end
16
+ # Replace the current URL.
17
+ #
18
+ # @param url [String, #to_s] the URL to go to
19
+ def replace(url)
20
+ `#@native.replace(#{url.to_s})`
21
+ end
29
22
 
30
- # Convert the location to a string.
31
- def to_s
32
- `#@native.toString()`
33
- end
23
+ # Reload the page.
24
+ #
25
+ # @param force [Boolean] whether to force the reload
26
+ def reload(force = false)
27
+ `#@native.reload(force)`
28
+ end
34
29
 
35
- # @!attribute fragment
36
- # @return [String] the hash fragment of the location URI
37
- alias_native :fragment, :hash
38
- alias_native :fragment=, :hash=
30
+ # Convert the location to a string.
31
+ def to_s
32
+ `#@native.toString()`
33
+ end
39
34
 
40
- # @!attribute host
41
- # @return [String] the host part of the location URI
42
- alias_native :host
43
- alias_native :host=
35
+ # @!attribute fragment
36
+ # @return [String] the hash fragment of the location URI
37
+ alias_native :fragment, :hash
38
+ alias_native :fragment=, :hash=
44
39
 
45
- # @!attribute uri
46
- # @return [String] the whole location URI
47
- alias_native :uri, :href
48
- alias_native :uri=, :href=
40
+ # @!attribute host
41
+ # @return [String] the host part of the location URI
42
+ alias_native :host
43
+ alias_native :host=
49
44
 
50
- # @!attribute path
51
- # @return [String] the path part of the location URI
52
- alias_native :path, :pathname
53
- alias_native :path=, :pathname=
45
+ # @!attribute uri
46
+ # @return [String] the whole location URI
47
+ alias_native :uri, :href
48
+ alias_native :uri=, :href=
54
49
 
55
- # @!attribute port
56
- # @return [Integer] the port part of the location URI
57
- alias_native :port
58
- alias_native :port=
50
+ # @!attribute path
51
+ # @return [String] the path part of the location URI
52
+ alias_native :path, :pathname
53
+ alias_native :path=, :pathname=
59
54
 
60
- # @!attribute scheme
61
- # @return [String] the scheme part of the location URI
62
- alias_native :scheme, :protocol
63
- alias_native :scheme=, :protocol=
55
+ # @!attribute port
56
+ # @return [Integer] the port part of the location URI
57
+ alias_native :port
58
+ alias_native :port=
64
59
 
65
- # @!attribute query
66
- # @return [String] the query part of the location URI
67
- alias_native :query, :search
68
- alias_native :query=, :search=
69
- end
60
+ # @!attribute scheme
61
+ # @return [String] the scheme part of the location URI
62
+ alias_native :scheme, :protocol
63
+ alias_native :scheme=, :protocol=
70
64
 
71
- class Window
72
- # @!attribute [r] location
73
- # @return [Location] the location for the window
74
- def location
75
- Location.new(`#@native.location`) if `#@native.location`
65
+ # @!attribute query
66
+ # @return [String] the query part of the location URI
67
+ alias_native :query, :search
68
+ alias_native :query=, :search=
69
+ end
70
+
71
+ class Window
72
+ # @!attribute [r] location
73
+ # @return [Location] the location for the window
74
+ def location
75
+ Location.new(`#@native.location`) if `#@native.location`
76
+ end
76
77
  end
77
- end
78
78
  end
@@ -1,5 +1,5 @@
1
1
  class Roda
2
2
  class Component
3
- VERSION = "0.1.69"
3
+ VERSION = "0.1.70"
4
4
  end
5
5
  end
@@ -178,14 +178,14 @@ class Roda
178
178
  end
179
179
 
180
180
  if trigger || action
181
- comp_response = '' if js && !comp_response
182
-
183
181
  load_component_js comp, action, options
184
182
 
185
183
  if js && comp_response.is_a?(Roda::Component::DOM)
186
184
  comp_response = comp_response.to_html
187
185
  end
188
186
 
187
+ comp_response = '' if js && !comp_response.is_a?(String)
188
+
189
189
  if comp_response.is_a?(String) && js
190
190
  comp_response << component_js
191
191
  end
@@ -18,8 +18,8 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_runtime_dependency "opal", "~> 0.7.1"
22
- spec.add_runtime_dependency "opal-jquery", "~> 0.3.0"
21
+ spec.add_runtime_dependency "opal"
22
+ spec.add_runtime_dependency "opal-jquery"
23
23
  spec.add_runtime_dependency "redis-rack"
24
24
  spec.add_runtime_dependency "rest-client"
25
25
  spec.add_runtime_dependency "faye", '~> 1.1.0'
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roda-component
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.69
4
+ version: 0.1.70
5
5
  platform: ruby
6
6
  authors:
7
7
  - cj
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-20 00:00:00.000000000 Z
11
+ date: 2015-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.7.1
19
+ version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.7.1
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: opal-jquery
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.3.0
33
+ version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.3.0
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: redis-rack
43
43
  requirement: !ruby/object:Gem::Requirement