dryml 2.0.1 → 2.1.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e227b41c5836dad5d8ca4b3bad11e08fd205fa4a
4
+ data.tar.gz: e40950a5d94b8daefdcaa7e28d432818a64c05ac
5
+ SHA512:
6
+ metadata.gz: 352912d8cd8ef48121aae28cbeaba2937d7f23a4ff1aef4a413f0439b77b3d4ee4158e7e7a1730292d8e759a4734b3289b97658329b2b7ecaf27248274a72e06
7
+ data.tar.gz: c64f26f4b59a9b5aee4a0055570b5b15bf74bd0ec94a65b773c9166b426206e2effee9a4b1759b4a28eb64b702cf6394d738da6252ae77c7f8d6e03899e1889b
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.1
1
+ 2.1.0.pre1
data/dryml.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.summary = "The Don't Repeat Yourself Markup Language"
12
12
  s.description = "The Don't Repeat Yourself Markup Language"
13
13
 
14
- s.add_runtime_dependency('actionpack', ["~> 3.2.0"])
14
+ s.add_runtime_dependency('actionpack', ["~> 4.0.2"])
15
15
  s.add_runtime_dependency('hobo_support', ["= #{version}"])
16
16
  s.add_development_dependency('rubydoctest', [">= 1.1.3"])
17
17
  s.add_development_dependency('cucumber', '~> 1.1.0')
data/lib/dryml/helper.rb CHANGED
@@ -21,7 +21,7 @@ module Dryml::Helper
21
21
  res = []
22
22
  empty = true
23
23
  scope.new_scope(:repeat_collection => enum, :even_odd => 'odd', :repeat_item => nil) do
24
- if enum.respond_to?(:each_pair)
24
+ if !enum.respond_to?(:to_a) && enum.respond_to?(:each_pair)
25
25
  enum.each_pair do |key, value|
26
26
  scope.repeat_item = value
27
27
  empty = false;
@@ -58,7 +58,7 @@ module Dryml::Helper
58
58
 
59
59
 
60
60
  def last_item?
61
- if scope.repeat_collection.respond_to? :each_pair
61
+ if !scope.repeat_collection.respond_to?(:to_a) && scope.repeat_collection.respond_to?(:each_pair)
62
62
  this == scope.repeat_collection.last.try.last
63
63
  else
64
64
  this == scope.repeat_collection.last
@@ -89,7 +89,7 @@
89
89
 
90
90
  # Generate the HMAC keyed message digest. Uses SHA1 by default.
91
91
  def generate_digest(data, session)
92
- secret = self.class.secret || Rails.application.config.secret_token
92
+ secret = self.class.secret || Rails.application.config.secret_key_base || Rails.application.config.secret_token
93
93
  key = secret.respond_to?(:call) ? secret.call(session) : secret
94
94
  OpenSSL::HMAC.hexdigest(OpenSSL::Digest::Digest.new(self.class.digest), key, data)
95
95
  end
@@ -10,6 +10,7 @@ module Dryml
10
10
  def find_templates(name, prefix, partial, details)
11
11
  tag_name = @controller.dryml_fallback_tag || name.dasherize + '-page'
12
12
  method_name = tag_name.to_s.gsub('-', '_')
13
+ details[:virtual_path] = "#{prefix}/#{name}"
13
14
  if Dryml.empty_page_renderer(@controller.view_context).respond_to?(method_name)
14
15
  [ActionView::Template.new('', Dryml.page_tag_identifier(@controller.controller_path, tag_name),
15
16
  Dryml::Railtie::TemplateHandler, details)]
data/lib/dryml/railtie.rb CHANGED
@@ -2,10 +2,8 @@ module Dryml
2
2
  class Railtie < Rails::Railtie
3
3
 
4
4
  ActiveSupport.on_load(:before_initialize) do |app|
5
- require 'dryml'
6
- require 'dryml/template'
7
- require 'dryml/dryml_generator'
8
5
  require 'dryml/railtie/page_tag_resolver'
6
+ require 'dryml/railtie/template_handler'
9
7
  end
10
8
 
11
9
  ActiveSupport.on_load(:action_controller) do
@@ -43,6 +43,12 @@ module Dryml
43
43
  view.instance_variables.each do |iv|
44
44
  instance_variable_set(iv, view.instance_variable_get(iv))
45
45
  end
46
+
47
+ # Rails 4 hack. Our method_missing hack doesn't get these because they're already (imporperly) defined. Not sure why
48
+ self.assets_prefix = view.assets_prefix
49
+ self.assets_environment = view.assets_environment
50
+ self.assets_manifest = view.assets_manifest
51
+ self.digest_assets = view.digest_assets
46
52
  end
47
53
  end
48
54
  end
@@ -166,12 +172,11 @@ module Dryml
166
172
  object = this
167
173
  end
168
174
  end
169
-
170
175
  id = if (!object.is_a?(ActiveRecord::Relation) && typed_id = object.try.typed_id)
171
- typed_id
172
- elsif object == @this
173
- "this"
174
- end
176
+ typed_id
177
+ else
178
+ "this"
179
+ end
175
180
  attribute ? "#{id}:#{attribute}" : id
176
181
  end
177
182
 
data/lib/dryml.rb CHANGED
@@ -80,7 +80,7 @@ module Dryml
80
80
 
81
81
  def imports_for_view(view)
82
82
  imports = []
83
- imports << Sprockets::Helpers::RailsHelper if defined?(Sprockets) && defined?(Rails)
83
+ imports << Sprockets::Rails::Helper if defined?(Sprockets) && defined?(Rails)
84
84
  imports << ActionView::Helpers if defined?(ActionView)
85
85
  imports + view.controller.class.modules_for_helpers(view.controller.class.all_helpers_from_path(view.controller.class.helpers_path))
86
86
  end
@@ -245,4 +245,25 @@ private
245
245
 
246
246
  end
247
247
 
248
- require 'dryml/railtie' if Object.const_defined?(:Rails)
248
+ require 'dryml/dryml_builder'
249
+ require 'dryml/dryml_doc'
250
+ require 'dryml/dryml_generator'
251
+ require 'dryml/helper'
252
+ require 'dryml/parser'
253
+ require 'dryml/part_context'
254
+ require 'dryml/scoped_variables'
255
+ require 'dryml/tag_parameters'
256
+ require 'dryml/taglib'
257
+ require 'dryml/template'
258
+ require 'dryml/template_environment'
259
+ require 'dryml/extensions/action_controller/dryml_methods'
260
+ require 'dryml/parser/attribute'
261
+ require 'dryml/parser/base_parser'
262
+ require 'dryml/parser/document'
263
+ require 'dryml/parser/element'
264
+ require 'dryml/parser/elements'
265
+ require 'dryml/parser/source'
266
+ require 'dryml/parser/text'
267
+ require 'dryml/parser/tree_parser'
268
+
269
+ require 'dryml/railtie' if defined?(Rails)
metadata CHANGED
@@ -1,52 +1,46 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dryml
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
5
- prerelease:
4
+ version: 2.1.0.pre1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Tom Locke
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-06-23 00:00:00.000000000 Z
11
+ date: 2013-12-18 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: actionpack
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
21
- version: 3.2.0
19
+ version: 4.0.2
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
29
- version: 3.2.0
26
+ version: 4.0.2
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: hobo_support
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - '='
36
32
  - !ruby/object:Gem::Version
37
- version: 2.0.1
33
+ version: 2.1.0.pre1
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - '='
44
39
  - !ruby/object:Gem::Version
45
- version: 2.0.1
40
+ version: 2.1.0.pre1
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rubydoctest
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - '>='
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - '>='
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: cucumber
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ~>
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ~>
76
67
  - !ruby/object:Gem::Version
@@ -78,7 +69,6 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: aruba
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ~>
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,6 @@ dependencies:
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ~>
92
81
  - !ruby/object:Gem::Version
@@ -163,28 +152,26 @@ files:
163
152
  - test/dryml.rdoctest
164
153
  homepage: http://hobocentral.net
165
154
  licenses: []
155
+ metadata: {}
166
156
  post_install_message:
167
157
  rdoc_options:
168
158
  - --charset=UTF-8
169
159
  require_paths:
170
160
  - lib
171
161
  required_ruby_version: !ruby/object:Gem::Requirement
172
- none: false
173
162
  requirements:
174
163
  - - '>='
175
164
  - !ruby/object:Gem::Version
176
165
  version: '0'
177
166
  required_rubygems_version: !ruby/object:Gem::Requirement
178
- none: false
179
167
  requirements:
180
168
  - - '>='
181
169
  - !ruby/object:Gem::Version
182
170
  version: 1.3.6
183
171
  requirements: []
184
172
  rubyforge_project: hobo
185
- rubygems_version: 1.8.25
173
+ rubygems_version: 2.1.11
186
174
  signing_key:
187
- specification_version: 3
175
+ specification_version: 4
188
176
  summary: The Don't Repeat Yourself Markup Language
189
177
  test_files: []
190
- has_rdoc: