locomotivecms_mounter 1.0.4 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +15 -0
  2. data/lib/locomotive/mounter/engine_api.rb +20 -8
  3. data/lib/locomotive/mounter/models/content_entry.rb +11 -6
  4. data/lib/locomotive/mounter/models/content_field.rb +39 -10
  5. data/lib/locomotive/mounter/models/content_type.rb +29 -2
  6. data/lib/locomotive/mounter/models/page.rb +8 -5
  7. data/lib/locomotive/mounter/models/translation.rb +1 -1
  8. data/lib/locomotive/mounter/reader/api/base.rb +54 -33
  9. data/lib/locomotive/mounter/reader/api/content_assets_reader.rb +3 -3
  10. data/lib/locomotive/mounter/reader/api/content_entries_reader.rb +24 -3
  11. data/lib/locomotive/mounter/reader/api/content_types_reader.rb +1 -1
  12. data/lib/locomotive/mounter/reader/api/pages_reader.rb +7 -2
  13. data/lib/locomotive/mounter/reader/api/theme_assets_reader.rb +2 -2
  14. data/lib/locomotive/mounter/reader/api/translations_reader.rb +2 -2
  15. data/lib/locomotive/mounter/reader/api.rb +12 -9
  16. data/lib/locomotive/mounter/reader/file_system/content_assets_reader.rb +2 -2
  17. data/lib/locomotive/mounter/version.rb +1 -1
  18. data/lib/locomotive/mounter/writer/api/base.rb +10 -2
  19. data/lib/locomotive/mounter/writer/api/theme_assets_writer.rb +29 -24
  20. data/lib/locomotive/mounter/writer/api/translations_writer.rb +6 -1
  21. data/lib/locomotive/mounter/writer/api.rb +3 -8
  22. data/lib/locomotive/mounter/writer/file_system/content_assets_writer.rb +2 -2
  23. data/lib/locomotive/mounter/writer/file_system/content_entries_writer.rb +0 -1
  24. data/lib/locomotive/mounter/writer/file_system/translations_writer.rb +2 -2
  25. data/lib/locomotive/mounter/writer/file_system.rb +1 -1
  26. metadata +9 -64
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ M2M1YjM0MTBkNjA5MmRiZmIyNzUyMTEyNjY1ZDE2M2MwMzg1NDk5OQ==
5
+ data.tar.gz: !binary |-
6
+ ZDA2MzhmMzA3NTdjZDIxNTk3ZmVmNDIzN2M1ZTAwNzNlMmVkNDI2ZQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ ZTRjOGE0OTBiNWEyYzM4Yjg2OGFkMjg2YjZmNGY0MDQ2ZGUxMmM5ZmFmODIz
10
+ MzFiMDU2MzExODE2OGE2NmYyZGMyYjU3MmM4NzhkNjMxODFjOGRkN2FjZmJl
11
+ NjdiNzllNWQzNzBkMDkzNzU4OGZkNjk4NjY5YzE5MDg4YTc4YjM=
12
+ data.tar.gz: !binary |-
13
+ M2UzZjczZWIxYjMxYmM0OTA1ZDAwYWYxNzVhMDFmYTYwZWQxMDNlMzA0M2M3
14
+ MGVmZDAzMDI4MmRmYTgzZTY0OWNmNjU2NWZkMzI3YTVkOGIxOTkzZWU2ZmZl
15
+ OTQyZjkxYzNlM2RmYTkxMDQyODA1NzQ2ZDhiNWQ0OWUzNTVkNWE=
@@ -11,20 +11,16 @@ module Locomotive
11
11
  # this class. It raises an exception if the operation fails.
12
12
  # Example of the base uri: locomotivecms.com, nocoffee.fr.
13
13
  #
14
- # @param [ Hash / Array ] *args A hash or parameters in that order: uri, email, password
14
+ # @param [ Hash / Array ] *args A hash or parameters in that order: uri, email, password or uri, api_key
15
15
  #
16
16
  # @return [ String ] The new token
17
17
  #
18
18
  def self.set_token(*args)
19
- uri, email, password = (if args.first.is_a?(Hash)
20
- [args.first[:uri], args.first[:email], args.first[:password]]
21
- else
22
- [*args]
23
- end)
19
+ _credentials = self.credentials(args)
24
20
 
25
- self.base_uri uri
21
+ self.base_uri _credentials.delete(:uri)
26
22
 
27
- response = post('/tokens.json', body: { email: email, password: password })
23
+ response = post('/tokens.json', body: _credentials) #{ email: email, password: password })
28
24
 
29
25
  if response.code < 400
30
26
  self.default_params auth_token: response['token']
@@ -39,6 +35,22 @@ module Locomotive
39
35
  Locomotive::Mounter::EngineApi.default_options[:default_params] = {}
40
36
  end
41
37
 
38
+ protected
39
+
40
+ def self.credentials(args)
41
+ if args.first.is_a?(Hash)
42
+ args.first
43
+ elsif args.size == 3
44
+ # uri, email, password
45
+ { uri: args[0], email: args[1], password: args[2] }
46
+ elsif args.size == 2
47
+ # uri, api_key
48
+ { uri: args[0], api_key: args[1] }
49
+ else
50
+ {}
51
+ end
52
+ end
53
+
42
54
  end
43
55
 
44
56
  end
@@ -117,8 +117,6 @@ module Locomotive
117
117
  value = self.localized_dynamic_attribute_value(field)
118
118
 
119
119
  case field.type
120
- when :string, :text, :select, :boolean, :category
121
- value
122
120
  when :date
123
121
  value.is_a?(String) ? Date.parse(value) : value
124
122
  when :file
@@ -129,6 +127,9 @@ module Locomotive
129
127
  field.klass.find_entries_by(field.inverse_of, [self._label, self._permalink])
130
128
  when :many_to_many
131
129
  field.klass.find_entries_among(value)
130
+ else
131
+ # :string, :text, :select, :boolean, :email, :integer, :float, :tags
132
+ value
132
133
  end
133
134
  end
134
135
 
@@ -172,7 +173,7 @@ module Locomotive
172
173
  end
173
174
  end
174
175
 
175
- # Returns a hash with the label_field value as the key and the other fields as the value
176
+ # Return a hash with the label_field value as the key and the other fields as the value
176
177
  #
177
178
  # @param [ Boolean ] nested True to have a hash of hash (whose key is the label)
178
179
  #
@@ -191,10 +192,14 @@ module Locomotive
191
192
  # no need of the translation of the field name in the current locale
192
193
  label_field = self.content_type.label_field
193
194
 
194
- if label_field.localized && !hash[label_field.name].empty?
195
- hash[label_field.name].delete(Locomotive::Mounter.locale.to_s)
195
+ if label_field.localized
196
+ if !hash[label_field.name].empty?
197
+ hash[label_field.name].delete(Locomotive::Mounter.locale.to_s)
196
198
 
197
- hash.delete(label_field.name) if hash[label_field.name].empty?
199
+ hash.delete(label_field.name) if hash[label_field.name].empty?
200
+ end
201
+ else
202
+ hash.delete(label_field.name)
198
203
  end
199
204
 
200
205
  nested ? { self._label => hash } : hash
@@ -75,16 +75,6 @@ module Locomotive
75
75
  self.select_options.detect { |option| option.name.to_s == name_or_id.to_s || option._id == name_or_id }
76
76
  end
77
77
 
78
- # Instead of returning a simple hash, it returns a hash with name as the key and
79
- # the remaining attributes as the value.
80
- #
81
- # @return [ Hash ] A hash of hash
82
- #
83
- def to_hash
84
- hash = super.delete_if { |k, v| %w(name position).include?(k) }
85
- { self.name => hash }
86
- end
87
-
88
78
  # Return the params used for the API.
89
79
  #
90
80
  # @return [ Hash ] The params
@@ -112,6 +102,28 @@ module Locomotive
112
102
  params
113
103
  end
114
104
 
105
+ # Instead of returning a simple hash, it returns a hash with name as the key and
106
+ # the remaining attributes as the value.
107
+ #
108
+ # @return [ Hash ] A hash of hash
109
+ #
110
+ def to_hash
111
+ hash = super.delete_if { |k, v| %w(name position).include?(k) }
112
+
113
+ # class_name is chosen over class_slug
114
+ if self.is_relationship?
115
+ hash['class_name'] ||= hash['class_slug']
116
+ hash.delete('class_slug')
117
+ end
118
+
119
+ # select options
120
+ if self.type == :select
121
+ hash['select_options'] = self.select_options_to_hash
122
+ end
123
+
124
+ { self.name => hash }
125
+ end
126
+
115
127
  protected
116
128
 
117
129
  # Clean up useless properties depending on its type
@@ -123,6 +135,23 @@ module Locomotive
123
135
  self.text_formatting = nil unless self.type == :text
124
136
  end
125
137
 
138
+ def select_options_to_hash
139
+ locales = self.select_options.map { |option| option.translated_in }.flatten.uniq
140
+ options = self.select_options.sort { |a, b| a.position <=> b.position }
141
+
142
+ if locales.size > 1
143
+ {}.tap do |by_locales|
144
+ locales.each do |locale|
145
+ options.each do |option|
146
+ (by_locales[locale.to_s] ||= []) << option.name_translations[locale]
147
+ end
148
+ end
149
+ end
150
+ else
151
+ options.map(&:name)
152
+ end
153
+ end
154
+
126
155
  end
127
156
 
128
157
  end
@@ -46,7 +46,7 @@ module Locomotive
46
46
  # @return [ Object ] The group_by field
47
47
  #
48
48
  def group_by_field
49
- self.fields.find_field(self.group_by_field_name)
49
+ self.find_field(self.group_by_field_name)
50
50
  end
51
51
 
52
52
  # Build a content entry and add it to the list of entries of the content type.
@@ -102,6 +102,14 @@ module Locomotive
102
102
  self.fields.select { |field| !field.is_relationship? }
103
103
  end
104
104
 
105
+ # Return the list of file fields.
106
+ #
107
+ # @return [ Array ] The list of file fields.
108
+ #
109
+ def file_fields
110
+ self.fields.select { |field| field.type == :file }
111
+ end
112
+
105
113
  # Find a field by its name (string or symbol) or its id (API)
106
114
  #
107
115
  # @param [ String / Symbol] name_or_id Name or Id of the field
@@ -171,6 +179,25 @@ module Locomotive
171
179
  params
172
180
  end
173
181
 
182
+ # Return a hash with sanitized attributes. It will be used to generate
183
+ # the corresponding yaml file.
184
+ #
185
+ # @return [ Hash ] A hash used by the to_yaml method
186
+ #
187
+ def to_hash
188
+ fields = %w(name slug description label_field_name order_by order_by_direction public_submission_enabled public_submission_accounts raw_item_template)
189
+
190
+ _attributes = self.attributes.delete_if { |k, v| !fields.include?(k.to_s) || v.blank? }.deep_stringify_keys
191
+
192
+ # group by
193
+ _attributes['group_by'] = self.group_by_field.name if self.group_by_field
194
+
195
+ # custom fields
196
+ _attributes['fields'] = self.fields
197
+
198
+ _attributes
199
+ end
200
+
174
201
  def to_s
175
202
  self.name
176
203
  end
@@ -205,7 +232,7 @@ module Locomotive
205
232
  end
206
233
 
207
234
  # define group_by_field from group_by_field_id
208
- if self.group_by_field_id
235
+ if self.group_by_field_name.blank? && self.group_by_field_id.present?
209
236
  self.group_by_field_name = self.find_field(self.group_by_field_id)
210
237
  end
211
238
 
@@ -14,8 +14,8 @@ module Locomotive
14
14
  field :redirect_type, default: 301
15
15
  field :template, localized: true
16
16
  field :handle
17
- field :listed
18
- field :templatized
17
+ field :listed, default: false
18
+ field :templatized, default: false
19
19
  field :content_type
20
20
  field :published, default: true
21
21
  field :cache_strategy
@@ -318,7 +318,7 @@ module Locomotive
318
318
  # @return [ String ] The YAML version of the page
319
319
  #
320
320
  def to_yaml
321
- fields = %w(title slug redirect_url redirect_type handle published listed cache_strategy response_type position)
321
+ fields = %w(title slug redirect_url redirect_type handle published listed cache_strategy response_type position seo_title meta_description meta_keywords)
322
322
 
323
323
  _attributes = self.attributes.delete_if { |k, v| !fields.include?(k.to_s) || v.blank? }.deep_stringify_keys
324
324
 
@@ -346,7 +346,8 @@ module Locomotive
346
346
  # @return [ Hash ] The params
347
347
  #
348
348
  def to_params
349
- params = self.filter_attributes %w(title parent_id slug redirect_url redirect_type handle listed published cache_strategy response_type position templatized)
349
+ params = self.filter_attributes %w(title parent_id slug redirect_url redirect_type handle listed published cache_strategy
350
+ response_type position templatized seo_title meta_description meta_keywords)
350
351
 
351
352
  # slug
352
353
  params.delete(:slug) if self.depth == 0
@@ -376,7 +377,9 @@ module Locomotive
376
377
  # @return [ Hash ] The safe params
377
378
  #
378
379
  def to_safe_params
379
- fields = %w(title slug listed published handle cache_strategy redirect_url response_type templatized content_type_id position)
380
+ fields = %w(title slug listed published handle cache_strategy
381
+ redirect_url response_type templatized content_type_id position
382
+ seo_title meta_description meta_keywords)
380
383
 
381
384
  params = self.attributes.delete_if do |k, v|
382
385
  !fields.include?(k.to_s) || (!v.is_a?(FalseClass) && v.blank?)
@@ -19,7 +19,7 @@ module Locomotive
19
19
  end
20
20
 
21
21
  def to_s
22
- self.key
22
+ "Translation {#{self.key}: #{self.values}}"
23
23
  end
24
24
 
25
25
  end
@@ -1,49 +1,70 @@
1
1
  module Locomotive
2
2
  module Mounter
3
3
  module Reader
4
- module Api
4
+ module Api
5
5
 
6
- class Base
6
+ class Base
7
7
 
8
- attr_accessor :runner, :items
8
+ attr_accessor :runner, :items
9
9
 
10
- def initialize(runner)
11
- self.runner = runner
12
- self.items = {}
13
- end
10
+ delegate :uri, :uri_with_scheme, to: :runner
11
+ delegate :locales, to: :mounting_point
14
12
 
15
- def mounting_point
16
- self.runner.mounting_point
17
- end
13
+ def initialize(runner)
14
+ self.runner = runner
15
+ self.items = {}
16
+ end
18
17
 
19
- def locales
20
- self.mounting_point.locales
21
- end
18
+ def mounting_point
19
+ self.runner.mounting_point
20
+ end
22
21
 
23
- def get(resource_name, locale = nil, raw = false)
24
- params = { query: {} }
22
+ def get(resource_name, locale = nil, raw = false)
23
+ params = { query: {} }
25
24
 
26
- params[:query][:locale] = locale if locale
25
+ params[:query][:locale] = locale if locale
27
26
 
28
- response = Locomotive::Mounter::EngineApi.get("/#{resource_name}.json", params).parsed_response
27
+ response = Locomotive::Mounter::EngineApi.get("/#{resource_name}.json", params).parsed_response
29
28
 
30
- return response if raw
29
+ return response if raw
31
30
 
32
- case response
33
- when Hash then response.to_hash.delete_if { |k, _| !self.safe_attributes.include?(k) }
34
- when Array
35
- response.map do |row|
36
- # puts "#{row.inspect}\n---" # DEBUG
37
- row.delete_if { |k, _| !self.safe_attributes.include?(k) }
38
- end
39
- else
40
- response
41
- end
42
- end
31
+ case response
32
+ when Hash then response.to_hash.delete_if { |k, _| !self.safe_attributes.include?(k) }
33
+ when Array
34
+ response.map do |row|
35
+ # puts "#{row.inspect}\n---" # DEBUG
36
+ row.delete_if { |k, _| !self.safe_attributes.include?(k) }
37
+ end
38
+ else
39
+ response
40
+ end
41
+ end
43
42
 
44
- end
43
+ # Build a new content asset from an url and a folder and add it
44
+ # to the global list of the content assets.
45
+ #
46
+ # @param [ String ] url The url of the content asset.
47
+ # @param [ String ] folder The folder of the content asset (optional).
48
+ #
49
+ # @return [ String ] The local path (not absolute) of the content asset.
50
+ #
51
+ def add_content_asset(url, folder = nil)
52
+ content_assets = self.mounting_point.resources[:content_assets]
45
53
 
46
- end
47
- end
48
- end
54
+ if (url =~ /^https?:\/\//).nil?
55
+ url = URI.join(self.uri_with_scheme, url)
56
+ end
57
+
58
+ asset = Locomotive::Mounter::Models::ContentAsset.new(uri: url, folder: folder)
59
+
60
+ content_assets[url.to_s] = asset
61
+
62
+ asset.local_filepath
63
+ end
64
+
65
+ end
66
+
67
+ end
68
+ end
69
+ end
49
70
  end
@@ -5,19 +5,19 @@ module Locomotive
5
5
 
6
6
  class ContentAssetsReader < Base
7
7
 
8
- # Build the list of theme assets from the public folder with eager loading.
8
+ # Build the list of content assets from the public folder with eager loading.
9
9
  #
10
10
  # @return [ Array ] The cached list of theme assets
11
11
  #
12
12
  def read
13
13
  base_uri = self.runner.uri.split('/').first
14
- base_uri = "http://#{base_uri}" unless base_uri =~ /^http:\/\//
14
+ base_uri = "http://#{base_uri}" unless base_uri =~ /^https?:\/\//
15
15
 
16
16
  self.get(:content_assets).each do |attributes|
17
17
  url = attributes.delete('url')
18
18
 
19
19
  attributes['folder'] = 'samples/assets'
20
- attributes['uri'] = URI(url =~ /http:\/\// ? url : "#{base_uri}#{url}")
20
+ attributes['uri'] = URI(url =~ /^https?:\/\// ? url : "#{base_uri}#{url}")
21
21
 
22
22
  self.items[url] = Locomotive::Mounter::Models::ContentAsset.new(attributes)
23
23
  end
@@ -80,21 +80,24 @@ module Locomotive
80
80
 
81
81
  content_type.fields.each do |field|
82
82
  value = (case field.type
83
- when :string, :boolean
83
+ when
84
84
  original_attributes[field.name]
85
85
  when :text
86
- self.replace_urls_by_content_assets(original_attributes[field.name])
86
+ replace_urls_by_content_assets(original_attributes[field.name])
87
87
  when :select
88
88
  field.find_select_option(original_attributes[field.name]).try(:name)
89
89
  when :date
90
90
  original_attributes["formatted_#{field.name}"]
91
+ when :file
92
+ retrieve_file_path(content_type, field, original_attributes)
91
93
  when :belongs_to, :many_to_many
92
94
  # push a relationship in the waiting line in order to be resolved at last
93
95
  target_field_name = field.type == :belongs_to ? "#{field.name}_id" : "#{field.name}_ids"
94
96
  self.relationships << { id: attributes['_id'], field: field.name, target_ids: original_attributes[target_field_name] }
95
97
  nil
96
98
  else
97
- nil
99
+ # :string, :boolean, :email, :integer, :float, :tags
100
+ original_attributes[field.name]
98
101
  end)
99
102
 
100
103
  attributes[field.name] = value unless value.nil?
@@ -134,6 +137,24 @@ module Locomotive
134
137
  content
135
138
  end
136
139
 
140
+ def retrieve_file_path(content_type, field, attributes)
141
+ value = attributes[field.name]
142
+
143
+ return nil if value.blank?
144
+
145
+ base_folder = File.join('/', 'samples', content_type.slug, attributes['_slug'])
146
+
147
+ if value.is_a?(Hash)
148
+ {}.tap do |translations|
149
+ value.each do |locale, url|
150
+ translations[locale] = self.add_content_asset(url, File.join(base_folder, locale))
151
+ end
152
+ end
153
+ else
154
+ self.add_content_asset(value, base_folder)
155
+ end
156
+ end
157
+
137
158
  end
138
159
 
139
160
  end
@@ -63,7 +63,7 @@ module Locomotive
63
63
  end
64
64
 
65
65
  def safe_attributes
66
- %w(name slug description order_by order_direction label_field_name group_by_field_id public_submission_accounts entries_custom_fields klass_name created_at updated_at)
66
+ %w(name slug description order_by order_direction label_field_name group_by_field_name public_submission_accounts entries_custom_fields klass_name created_at updated_at)
67
67
  end
68
68
 
69
69
  end
@@ -144,9 +144,14 @@ module Locomotive
144
144
  #
145
145
  def filter_editable_elements(list)
146
146
  list.map do |attributes|
147
+ type = attributes['type']
147
148
  attributes.keep_if { |k, _| %w(_id block slug content).include?(k) }.tap do |hash|
148
- self.mounting_point.content_assets.each do |path, asset|
149
- hash['content'].gsub!(path, asset.local_filepath)
149
+ if type == 'EditableFile'
150
+ hash['content'] = self.add_content_asset(hash['content'], '/samples/pages')
151
+ else
152
+ self.mounting_point.content_assets.each do |path, asset|
153
+ hash['content'].gsub!(path, asset.local_filepath)
154
+ end
150
155
  end
151
156
  end
152
157
  end
@@ -16,12 +16,12 @@ module Locomotive
16
16
  #
17
17
  def read
18
18
  base_uri = self.runner.uri.split('/').first
19
- base_uri = "http://#{base_uri}" unless base_uri =~ /^http:\/\//
19
+ base_uri = "http://#{base_uri}" unless base_uri =~ /^https?:\/\//
20
20
 
21
21
  self.items = self.get(:theme_assets).map do |attributes|
22
22
  url = attributes.delete('url')
23
23
 
24
- attributes['uri'] = URI(url =~ /http:\/\// ? url : "#{base_uri}#{url}")
24
+ attributes['uri'] = URI(url =~ /^https?:\/\// ? url : "#{base_uri}#{url}")
25
25
 
26
26
  Locomotive::Mounter::Models::ThemeAsset.new(attributes)
27
27
  end
@@ -10,8 +10,8 @@ module Locomotive
10
10
  # @return [ Array ] The cached list of theme assets
11
11
  #
12
12
  def read
13
- self.items = get(:translations).map do |attributes|
14
- Locomotive::Mounter::Models::Translation.new(attributes)
13
+ self.items = get(:translations).each_with_object({}) do |attributes,hash|
14
+ hash[attributes['key']] = Locomotive::Mounter::Models::Translation.new(attributes)
15
15
  end
16
16
  end
17
17
 
@@ -10,7 +10,7 @@ module Locomotive
10
10
  def self.instance
11
11
  @@instance ||= Runner.new(:api)
12
12
  end
13
-
13
+
14
14
  def self.teardown
15
15
  @@instance = nil
16
16
  end
@@ -22,16 +22,11 @@ module Locomotive
22
22
  # Call the LocomotiveCMS engine to get a token for
23
23
  # the next API calls
24
24
  def prepare
25
- self.uri = self.parameters.delete(:uri)
26
- email = self.parameters.delete(:email)
27
- password = self.parameters.delete(:password)
28
-
29
- if uri.blank? || email.blank? || password.blank?
30
- raise Locomotive::Mounter::ReaderException.new("one or many API credentials (uri, email, password) are missing")
31
- end
25
+ credentials = self.parameters.select { |k, _| %w(uri email password api_key).include?(k.to_s) }
26
+ self.uri = credentials[:uri]
32
27
 
33
28
  begin
34
- Locomotive::Mounter::EngineApi.set_token(uri, email, password)
29
+ Locomotive::Mounter::EngineApi.set_token(credentials)
35
30
  rescue Exception => e
36
31
  raise Locomotive::Mounter::ReaderException.new("unable to get an API token: #{e.message}")
37
32
  end
@@ -45,6 +40,14 @@ module Locomotive
45
40
  [SiteReader, ContentAssetsReader, SnippetsReader, ContentTypesReader, ContentEntriesReader, PagesReader, ThemeAssetsReader, TranslationsReader]
46
41
  end
47
42
 
43
+ # Return the uri with the scheme (http://)
44
+ #
45
+ # @return [ String ] The uri starting by http://
46
+ #
47
+ def uri_with_scheme
48
+ self.uri =~ /^http/ ? self.uri : "http://#{self.uri}"
49
+ end
50
+
48
51
  end
49
52
 
50
53
  end
@@ -10,7 +10,7 @@ module Locomotive
10
10
  # @return [ Array ] The list of content assets
11
11
  #
12
12
  def read
13
- self.items = [] # prefer an array over a hash
13
+ self.items = {} # prefer an array over a hash
14
14
 
15
15
  self.fetch_from_pages
16
16
 
@@ -66,7 +66,7 @@ module Locomotive
66
66
  source.to_s.match(/\/samples\/.*\.[a-zA-Z0-9]+/) do |match|
67
67
  filepath = File.join(self.root_dir, match.to_s)
68
68
  folder = File.dirname(match.to_s)
69
- self.items << Locomotive::Mounter::Models::ContentAsset.new(filepath: filepath, folder: folder)
69
+ self.items[source] = Locomotive::Mounter::Models::ContentAsset.new(filepath: filepath, folder: folder)
70
70
  end
71
71
  end
72
72
 
@@ -2,7 +2,7 @@
2
2
  module Locomotive
3
3
  module Mounter #:nodoc
4
4
 
5
- VERSION = '1.0.4'
5
+ VERSION = '1.1.0'
6
6
 
7
7
  end
8
8
  end
@@ -188,6 +188,14 @@ module Locomotive
188
188
  end
189
189
 
190
190
  protected
191
+
192
+ def truncate(string, length = 50, separator = '[...]')
193
+ if string.length > length
194
+ string[0..(length - separator.length)] + separator
195
+ else
196
+ string
197
+ end
198
+ end
191
199
 
192
200
  def response_to_status(response)
193
201
  response ? :success : :error
@@ -248,7 +256,7 @@ module Locomotive
248
256
  when :same then 'same'.colorize(color: :magenta)
249
257
  when :not_translated then 'not translated (itself or parent)'.colorize(color: :yellow)
250
258
  end
251
-
259
+
252
260
  spaces = '.' * (80 - self.resource_message(resource).size)
253
261
  self.log "#{spaces}[#{status_label}]\n"
254
262
 
@@ -265,7 +273,7 @@ module Locomotive
265
273
  #
266
274
  def resource_message(resource)
267
275
  op_label = resource.persisted? ? 'updating': 'creating'
268
- " #{op_label} #{resource.to_s}"
276
+ " #{op_label} #{truncate(resource.to_s)}"
269
277
  end
270
278
 
271
279
  # Log a message to the console or the logger depending on the options
@@ -14,9 +14,17 @@ module Locomotive
14
14
  # Other local attributes
15
15
  attr_accessor :tmp_folder
16
16
 
17
+ # store checksums of remote assets. needed to check if an asset has to be updated or not
18
+ attr_accessor :checksums
19
+
20
+ # the assets stored in the engine have the same base url
21
+ attr_accessor :remote_base_url
22
+
17
23
  def prepare
18
24
  super
19
25
 
26
+ self.checksums = {}
27
+
20
28
  # prepare the place where the assets will be stored temporarily.
21
29
  self.create_tmp_folder
22
30
 
@@ -25,8 +33,13 @@ module Locomotive
25
33
  remote_path = File.join('/', attributes['folder'], File.basename(attributes['local_path']))
26
34
 
27
35
  if theme_asset = self.theme_assets[remote_path]
28
- theme_asset._id = attributes['id']
29
- theme_asset.size = attributes['raw_size'].to_i
36
+ theme_asset._id = attributes['id']
37
+ self.checksums[theme_asset._id] = attributes['checksum']
38
+ end
39
+
40
+ if remote_base_url.nil?
41
+ attributes['url'] =~ /(.*\/sites\/[0-9a-f]+\/theme)/
42
+ self.remote_base_url = $1
30
43
  end
31
44
  end
32
45
  end
@@ -44,7 +57,7 @@ module Locomotive
44
57
  begin
45
58
  if theme_asset.persisted?
46
59
  # we only update it if the size has changed or if the force option has been set.
47
- if self.force? || self.theme_asset_changed?(theme_asset, file)
60
+ if self.force? || self.theme_asset_changed?(theme_asset)
48
61
  response = self.put :theme_assets, theme_asset._id, params
49
62
  status = self.response_to_status(response)
50
63
  else
@@ -129,36 +142,28 @@ module Locomotive
129
142
  self.theme_assets.values.sort { |a, b| a.priority <=> b.priority }
130
143
  end
131
144
 
132
- # Tell if the theme_asset has changed in order to update it
145
+ # Tell if the theme_asset has been changed in order to update it
133
146
  # if so or simply skip it.
134
147
  #
135
148
  # @param [ Object ] theme_asset The theme asset
136
- # @param [ Object ] tmp_file The size of the file (after precompilation if required)
137
149
  #
138
- # @return [ Boolean ] True if the source of the 2 assets (local and remote) is different.
150
+ # @return [ Boolean ] True if the checksums of the local and remote files are different.
139
151
  #
140
- def theme_asset_changed?(theme_asset, tmp_file)
141
- if theme_asset.stylesheet_or_javascript?
142
- # we need to compare compiled contents (sass, coffeescript) with the right urls
143
- tmp_content = ''
152
+ def theme_asset_changed?(theme_asset)
153
+ content = theme_asset.content
144
154
 
145
- begin
146
- File.open(tmp_file, 'rb') do |file|
147
- tmp_content = file.read.encode('utf-8', replace: nil)
148
- end
149
- rescue Encoding::UndefinedConversionError => e
150
- # in the doubt, we prefer to return true
151
- return true
152
- end
155
+ if theme_asset.stylesheet_or_javascript?
156
+ # we need to compare compiled contents (sass, coffeescript) with the right urls inside
157
+ content = content.gsub(/[("'](\/(stylesheets|javascripts|images|media|others)\/(([^;.]+)\/)*([a-zA-Z_\-0-9]+)\.[a-z]{2,3})[)"']/) do |path|
158
+ sanitized_path = path.gsub(/[("')]/, '').gsub(/^\//, '')
159
+ sanitized_path = File.join(self.remote_base_url, sanitized_path)
153
160
 
154
- tmp_content = tmp_content.gsub(/[("']([^)"']*)\/sites\/[0-9a-f]{24}\/theme\/(([^;.]+)\/)*([a-zA-Z_\-0-9]+\.[a-z]{2,3})[)"']/) do |path|
155
- "#{path.first}/#{$2 + $4}#{path.last}"
161
+ "#{path.first}#{sanitized_path}#{path.last}"
156
162
  end
157
-
158
- tmp_content != theme_asset.content
159
- else
160
- Digest::SHA1.file(tmp_file).hexdigest != Digest::SHA1.file(theme_asset.filepath).hexdigest
161
163
  end
164
+
165
+ # compare local checksum with the remote one
166
+ Digest::MD5.hexdigest(content) != self.checksums[theme_asset._id]
162
167
  end
163
168
 
164
169
  end
@@ -5,11 +5,12 @@ module Locomotive
5
5
 
6
6
  # Push translations to a remote LocomotiveCMS engine.
7
7
  #
8
- # The force option is not used.
8
+ # Only pushes if force_translations flag is set
9
9
  #
10
10
  class TranslationsWriter < Base
11
11
 
12
12
  def prepare
13
+ return unless force_translations?
13
14
  super
14
15
 
15
16
  # set the unique identifier to each local translation
@@ -22,6 +23,7 @@ module Locomotive
22
23
 
23
24
  # Write all the translations to the remote destination
24
25
  def write
26
+ return unless force_translations?
25
27
  self.translations.each do |key, translation|
26
28
  self.output_resource_op translation
27
29
 
@@ -34,6 +36,9 @@ module Locomotive
34
36
 
35
37
  protected
36
38
 
39
+ def force_translations?
40
+ self.runner.parameters[:force_translations] || false
41
+ end
37
42
  # Persist a translation by calling the API. The returned id
38
43
  # is then set to the translation itself.
39
44
  #
@@ -25,16 +25,11 @@ module Locomotive
25
25
  # by default, do not push data (content entries and editable elements)
26
26
  self.parameters[:data] ||= false
27
27
 
28
- self.uri = self.parameters.delete(:uri)
29
- email = self.parameters.delete(:email)
30
- password = self.parameters.delete(:password)
31
-
32
- if uri.blank? || email.blank? || password.blank?
33
- raise Locomotive::Mounter::WriterException.new("one or many API credentials (uri, email, password) are missing")
34
- end
28
+ credentials = self.parameters.select { |k, _| %w(uri email password api_key).include?(k.to_s) }
29
+ self.uri = credentials[:uri]
35
30
 
36
31
  begin
37
- Locomotive::Mounter::EngineApi.set_token(uri, email, password)
32
+ Locomotive::Mounter::EngineApi.set_token(credentials)
38
33
  rescue Exception => e
39
34
  raise Locomotive::Mounter::WriterException.new("unable to get an API token: #{e.message}")
40
35
  end
@@ -5,12 +5,12 @@ module Locomotive
5
5
 
6
6
  class ContentAssetsWriter < Base
7
7
 
8
- # It creates the theme assets folders
8
+ # It creates the content assets folder
9
9
  def prepare
10
10
  self.create_folder 'public'
11
11
  end
12
12
 
13
- # It writes all the snippets into files
13
+ # It writes all the content assets into files
14
14
  def write
15
15
  self.mounting_point.content_assets.each do |_, asset|
16
16
  self.open_file(self.target_asset_path(asset), 'wb') do |file|
@@ -22,7 +22,6 @@ module Locomotive
22
22
  end
23
23
 
24
24
  end
25
-
26
25
  end
27
26
  end
28
27
  end
@@ -10,8 +10,8 @@ module Locomotive
10
10
  end
11
11
 
12
12
  def write
13
- content = self.mounting_point.translations.each_with_object({}) do |translation, hash|
14
- hash[translation.key] = translation.values
13
+ content = self.mounting_point.translations.each_with_object({}) do |(key,translation), hash|
14
+ hash[key] = translation.values
15
15
  end
16
16
 
17
17
  content = content.empty? ? '' : content.to_yaml
@@ -31,7 +31,7 @@ module Locomotive
31
31
  # @return [ Array ] List of the writer classes
32
32
  #
33
33
  def writers
34
- [SiteWriter, SnippetsWriter, ContentTypesWriter, ContentEntriesWriter, PagesWriter, ThemeAssetsWriter, TranslationsWriter]
34
+ [SiteWriter, SnippetsWriter, ContentTypesWriter, ContentEntriesWriter, PagesWriter, ThemeAssetsWriter, ContentAssetsWriter, TranslationsWriter]
35
35
  # [SiteWriter, PagesWriter, SnippetsWriter, ContentTypesWriter, ContentEntriesWriter, ContentAssetsWriter, ThemeAssetsWriter, TranslationsWriter]
36
36
  end
37
37
 
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locomotivecms_mounter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
5
- prerelease:
4
+ version: 1.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Didier Lafforgue
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-04-19 00:00:00.000000000 Z
11
+ date: 2013-06-05 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: tilt
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - '='
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
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
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: haml
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - '='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
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
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: sass
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: :runtime
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: compass
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: :runtime
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: coffee-script
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: :runtime
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
@@ -94,7 +83,6 @@ dependencies:
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: less
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
87
  - - ~>
100
88
  - !ruby/object:Gem::Version
@@ -102,7 +90,6 @@ dependencies:
102
90
  type: :runtime
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
94
  - - ~>
108
95
  - !ruby/object:Gem::Version
@@ -110,7 +97,6 @@ dependencies:
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: RedCloth
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
101
  - - ~>
116
102
  - !ruby/object:Gem::Version
@@ -118,7 +104,6 @@ dependencies:
118
104
  type: :runtime
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
108
  - - ~>
124
109
  - !ruby/object:Gem::Version
@@ -126,7 +111,6 @@ dependencies:
126
111
  - !ruby/object:Gem::Dependency
127
112
  name: activesupport
128
113
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
115
  - - ~>
132
116
  - !ruby/object:Gem::Version
@@ -134,7 +118,6 @@ dependencies:
134
118
  type: :runtime
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
121
  requirements:
139
122
  - - ~>
140
123
  - !ruby/object:Gem::Version
@@ -142,7 +125,6 @@ dependencies:
142
125
  - !ruby/object:Gem::Dependency
143
126
  name: i18n
144
127
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
128
  requirements:
147
129
  - - ~>
148
130
  - !ruby/object:Gem::Version
@@ -150,7 +132,6 @@ dependencies:
150
132
  type: :runtime
151
133
  prerelease: false
152
134
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
135
  requirements:
155
136
  - - ~>
156
137
  - !ruby/object:Gem::Version
@@ -158,7 +139,6 @@ dependencies:
158
139
  - !ruby/object:Gem::Dependency
159
140
  name: stringex
160
141
  requirement: !ruby/object:Gem::Requirement
161
- none: false
162
142
  requirements:
163
143
  - - ~>
164
144
  - !ruby/object:Gem::Version
@@ -166,7 +146,6 @@ dependencies:
166
146
  type: :runtime
167
147
  prerelease: false
168
148
  version_requirements: !ruby/object:Gem::Requirement
169
- none: false
170
149
  requirements:
171
150
  - - ~>
172
151
  - !ruby/object:Gem::Version
@@ -174,7 +153,6 @@ dependencies:
174
153
  - !ruby/object:Gem::Dependency
175
154
  name: multi_json
176
155
  requirement: !ruby/object:Gem::Requirement
177
- none: false
178
156
  requirements:
179
157
  - - ~>
180
158
  - !ruby/object:Gem::Version
@@ -182,7 +160,6 @@ dependencies:
182
160
  type: :runtime
183
161
  prerelease: false
184
162
  version_requirements: !ruby/object:Gem::Requirement
185
- none: false
186
163
  requirements:
187
164
  - - ~>
188
165
  - !ruby/object:Gem::Version
@@ -190,7 +167,6 @@ dependencies:
190
167
  - !ruby/object:Gem::Dependency
191
168
  name: httmultiparty
192
169
  requirement: !ruby/object:Gem::Requirement
193
- none: false
194
170
  requirements:
195
171
  - - '='
196
172
  - !ruby/object:Gem::Version
@@ -198,7 +174,6 @@ dependencies:
198
174
  type: :runtime
199
175
  prerelease: false
200
176
  version_requirements: !ruby/object:Gem::Requirement
201
- none: false
202
177
  requirements:
203
178
  - - '='
204
179
  - !ruby/object:Gem::Version
@@ -206,23 +181,20 @@ dependencies:
206
181
  - !ruby/object:Gem::Dependency
207
182
  name: json
208
183
  requirement: !ruby/object:Gem::Requirement
209
- none: false
210
184
  requirements:
211
185
  - - ~>
212
186
  - !ruby/object:Gem::Version
213
- version: 1.6.5
187
+ version: 1.8.0
214
188
  type: :runtime
215
189
  prerelease: false
216
190
  version_requirements: !ruby/object:Gem::Requirement
217
- none: false
218
191
  requirements:
219
192
  - - ~>
220
193
  - !ruby/object:Gem::Version
221
- version: 1.6.5
194
+ version: 1.8.0
222
195
  - !ruby/object:Gem::Dependency
223
196
  name: mime-types
224
197
  requirement: !ruby/object:Gem::Requirement
225
- none: false
226
198
  requirements:
227
199
  - - ~>
228
200
  - !ruby/object:Gem::Version
@@ -230,7 +202,6 @@ dependencies:
230
202
  type: :runtime
231
203
  prerelease: false
232
204
  version_requirements: !ruby/object:Gem::Requirement
233
- none: false
234
205
  requirements:
235
206
  - - ~>
236
207
  - !ruby/object:Gem::Version
@@ -238,7 +209,6 @@ dependencies:
238
209
  - !ruby/object:Gem::Dependency
239
210
  name: zip
240
211
  requirement: !ruby/object:Gem::Requirement
241
- none: false
242
212
  requirements:
243
213
  - - ~>
244
214
  - !ruby/object:Gem::Version
@@ -246,7 +216,6 @@ dependencies:
246
216
  type: :runtime
247
217
  prerelease: false
248
218
  version_requirements: !ruby/object:Gem::Requirement
249
- none: false
250
219
  requirements:
251
220
  - - ~>
252
221
  - !ruby/object:Gem::Version
@@ -254,7 +223,6 @@ dependencies:
254
223
  - !ruby/object:Gem::Dependency
255
224
  name: colorize
256
225
  requirement: !ruby/object:Gem::Requirement
257
- none: false
258
226
  requirements:
259
227
  - - ~>
260
228
  - !ruby/object:Gem::Version
@@ -262,7 +230,6 @@ dependencies:
262
230
  type: :runtime
263
231
  prerelease: false
264
232
  version_requirements: !ruby/object:Gem::Requirement
265
- none: false
266
233
  requirements:
267
234
  - - ~>
268
235
  - !ruby/object:Gem::Version
@@ -270,7 +237,6 @@ dependencies:
270
237
  - !ruby/object:Gem::Dependency
271
238
  name: logger
272
239
  requirement: !ruby/object:Gem::Requirement
273
- none: false
274
240
  requirements:
275
241
  - - ! '>='
276
242
  - !ruby/object:Gem::Version
@@ -278,7 +244,6 @@ dependencies:
278
244
  type: :runtime
279
245
  prerelease: false
280
246
  version_requirements: !ruby/object:Gem::Requirement
281
- none: false
282
247
  requirements:
283
248
  - - ! '>='
284
249
  - !ruby/object:Gem::Version
@@ -286,7 +251,6 @@ dependencies:
286
251
  - !ruby/object:Gem::Dependency
287
252
  name: rake
288
253
  requirement: !ruby/object:Gem::Requirement
289
- none: false
290
254
  requirements:
291
255
  - - '='
292
256
  - !ruby/object:Gem::Version
@@ -294,7 +258,6 @@ dependencies:
294
258
  type: :development
295
259
  prerelease: false
296
260
  version_requirements: !ruby/object:Gem::Requirement
297
- none: false
298
261
  requirements:
299
262
  - - '='
300
263
  - !ruby/object:Gem::Version
@@ -302,7 +265,6 @@ dependencies:
302
265
  - !ruby/object:Gem::Dependency
303
266
  name: rspec
304
267
  requirement: !ruby/object:Gem::Requirement
305
- none: false
306
268
  requirements:
307
269
  - - ~>
308
270
  - !ruby/object:Gem::Version
@@ -310,7 +272,6 @@ dependencies:
310
272
  type: :development
311
273
  prerelease: false
312
274
  version_requirements: !ruby/object:Gem::Requirement
313
- none: false
314
275
  requirements:
315
276
  - - ~>
316
277
  - !ruby/object:Gem::Version
@@ -318,7 +279,6 @@ dependencies:
318
279
  - !ruby/object:Gem::Dependency
319
280
  name: mocha
320
281
  requirement: !ruby/object:Gem::Requirement
321
- none: false
322
282
  requirements:
323
283
  - - '='
324
284
  - !ruby/object:Gem::Version
@@ -326,7 +286,6 @@ dependencies:
326
286
  type: :development
327
287
  prerelease: false
328
288
  version_requirements: !ruby/object:Gem::Requirement
329
- none: false
330
289
  requirements:
331
290
  - - '='
332
291
  - !ruby/object:Gem::Version
@@ -334,7 +293,6 @@ dependencies:
334
293
  - !ruby/object:Gem::Dependency
335
294
  name: rack-test
336
295
  requirement: !ruby/object:Gem::Requirement
337
- none: false
338
296
  requirements:
339
297
  - - ~>
340
298
  - !ruby/object:Gem::Version
@@ -342,7 +300,6 @@ dependencies:
342
300
  type: :development
343
301
  prerelease: false
344
302
  version_requirements: !ruby/object:Gem::Requirement
345
- none: false
346
303
  requirements:
347
304
  - - ~>
348
305
  - !ruby/object:Gem::Version
@@ -350,7 +307,6 @@ dependencies:
350
307
  - !ruby/object:Gem::Dependency
351
308
  name: ruby-debug-wrapper
352
309
  requirement: !ruby/object:Gem::Requirement
353
- none: false
354
310
  requirements:
355
311
  - - ~>
356
312
  - !ruby/object:Gem::Version
@@ -358,7 +314,6 @@ dependencies:
358
314
  type: :development
359
315
  prerelease: false
360
316
  version_requirements: !ruby/object:Gem::Requirement
361
- none: false
362
317
  requirements:
363
318
  - - ~>
364
319
  - !ruby/object:Gem::Version
@@ -366,7 +321,6 @@ dependencies:
366
321
  - !ruby/object:Gem::Dependency
367
322
  name: vcr
368
323
  requirement: !ruby/object:Gem::Requirement
369
- none: false
370
324
  requirements:
371
325
  - - '='
372
326
  - !ruby/object:Gem::Version
@@ -374,7 +328,6 @@ dependencies:
374
328
  type: :development
375
329
  prerelease: false
376
330
  version_requirements: !ruby/object:Gem::Requirement
377
- none: false
378
331
  requirements:
379
332
  - - '='
380
333
  - !ruby/object:Gem::Version
@@ -382,23 +335,20 @@ dependencies:
382
335
  - !ruby/object:Gem::Dependency
383
336
  name: therubyracer
384
337
  requirement: !ruby/object:Gem::Requirement
385
- none: false
386
338
  requirements:
387
339
  - - ~>
388
340
  - !ruby/object:Gem::Version
389
- version: 0.10.2
341
+ version: 0.11.4
390
342
  type: :development
391
343
  prerelease: false
392
344
  version_requirements: !ruby/object:Gem::Requirement
393
- none: false
394
345
  requirements:
395
346
  - - ~>
396
347
  - !ruby/object:Gem::Version
397
- version: 0.10.2
348
+ version: 0.11.4
398
349
  - !ruby/object:Gem::Dependency
399
350
  name: webmock
400
351
  requirement: !ruby/object:Gem::Requirement
401
- none: false
402
352
  requirements:
403
353
  - - '='
404
354
  - !ruby/object:Gem::Version
@@ -406,7 +356,6 @@ dependencies:
406
356
  type: :development
407
357
  prerelease: false
408
358
  version_requirements: !ruby/object:Gem::Requirement
409
- none: false
410
359
  requirements:
411
360
  - - '='
412
361
  - !ruby/object:Gem::Version
@@ -491,29 +440,25 @@ files:
491
440
  - lib/locomotive/mounter.rb
492
441
  homepage: http://www.locomotivecms.com
493
442
  licenses: []
443
+ metadata: {}
494
444
  post_install_message:
495
445
  rdoc_options: []
496
446
  require_paths:
497
447
  - lib
498
448
  required_ruby_version: !ruby/object:Gem::Requirement
499
- none: false
500
449
  requirements:
501
450
  - - ! '>='
502
451
  - !ruby/object:Gem::Version
503
452
  version: '0'
504
- segments:
505
- - 0
506
- hash: 2290558764515626735
507
453
  required_rubygems_version: !ruby/object:Gem::Requirement
508
- none: false
509
454
  requirements:
510
455
  - - ! '>='
511
456
  - !ruby/object:Gem::Version
512
457
  version: 1.3.6
513
458
  requirements: []
514
459
  rubyforge_project: locomotivecms_mounter
515
- rubygems_version: 1.8.23
460
+ rubygems_version: 2.0.3
516
461
  signing_key:
517
- specification_version: 3
462
+ specification_version: 4
518
463
  summary: LocomotiveCMS Mounter
519
464
  test_files: []