hot-glue 0.3.7 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aab4adde73436f151d09f4e21517d108adcfb47df5f6a0fd69153848fa695aeb
4
- data.tar.gz: 8230d3d19dc1f0a4d731b0492f8ecf5d4a1dd17fb2a2ab9934c8c2884a67e000
3
+ metadata.gz: ea147399cbbc04e307d97c495a43e549b88bf99b44946a3392c0f0cf96d53f2d
4
+ data.tar.gz: 2d05eb14eaf6360b4df436ba453484a13abf9dc94c6ae472a205744aac10c50c
5
5
  SHA512:
6
- metadata.gz: 5649e791538ab4401ff362bcab08809742b3000b2c6d59254d597737153ccbd9832137366af053936fcfcbfdaf6c5fa51904f81a86b762657ba14f7c8b67f35a
7
- data.tar.gz: 8670d81ec27f0173d472d1507009b981493a997e9c7eeb8afaeb9a7fb701110ef8f90b90e6f462156675032446b4d1f443410c8195a923536a8ceee84e31d524
6
+ metadata.gz: 1e29fd08a71cbc94ac38c5502bd5436184100378206d24222c20320f62ec441dc8863972bdb7e8486b5f80e2859d4070cf4247da1b637d3132c1f188725c9503
7
+ data.tar.gz: e24788fc22a3ed4bb2e63f4ea982650b722e3c5cf34ed960bbe8fee4540cbaa3b3a843a315488e6c6797790757f42c6b5154cea395b7f0bbbd04cf02e747e1cb
@@ -29,12 +29,14 @@ module HotGlue
29
29
 
30
30
 
31
31
  print "(To purchase a license, please see https://heliosdev.shop/hot-glue-license) \n Please enter your license key: "
32
- license_activation_key = STDIN.gets
32
+ license_activation_key = STDIN.gets.strip
33
33
 
34
34
  print "Please enter the EMAIL you used to purchase this license: "
35
- license_email = STDIN.gets
35
+ license_email = STDIN.gets.strip
36
36
  app_name = Rails.application.class.module_parent_name
37
- license_should_be = Digest::SHA1.hexdigest("HotGlueLicense--#{app_name}--#{license_email}")
37
+ license_should_be = Digest::SHA1.hexdigest("HOT-GLUE-LICENSE--#{app_name}--#{license_email}")
38
+
39
+
38
40
  if (license_should_be != license_activation_key)
39
41
  puts "Ooops... it seems that Hot Glue license is not valid. Please check 1) the email address you used for this license, 2) The app name you used to purchase this license, and 3) the activation key itself."
40
42
  exit
@@ -168,17 +168,20 @@ module HotGlue
168
168
  singular_class = args[0][:singular_class]
169
169
  singular = args[0][:singular]
170
170
  perc_width = args[0][:perc_width]
171
+ layout = args[0][:layout]
171
172
 
172
173
  columns_count = columns.count + 1
173
174
  perc_width = (perc_width).floor
174
175
 
175
- if @layout == "boostrap"
176
+ if layout == "bootstrap"
176
177
  col_identifer = "col"
177
-
178
+ style_with_flex_basis = ""
178
179
  else
180
+ style_with_flex_basis = " style='flex-basis: #{perc_width}%'"
179
181
  col_identifer = "scaffold-cell"
180
-
181
182
  end
183
+
184
+
182
185
  columns.map { |col|
183
186
  type = eval("#{singular_class}.columns_hash['#{col}']").type
184
187
  limit = eval("#{singular_class}.columns_hash['#{col}']").limit
@@ -203,30 +206,30 @@ module HotGlue
203
206
 
204
207
  display_column = HotGlue.derrive_reference_name(assoc.class_name)
205
208
 
206
- "<div class='#{col_identifer}' style='flex-basis: #{perc_width}%'>
209
+ "<div class='#{col_identifer}'#{style_with_flex_basis}>
207
210
  <%= #{singular}.#{assoc.name.to_s}.try(:#{display_column}) || '<span class=\"content alert-danger\">MISSING</span>'.html_safe %>
208
211
  </div>"
209
212
 
210
213
  else
211
- "<div class='#{col_identifer}' style='flex-basis: #{perc_width}%'>
214
+ "<div class='#{col_identifer}'#{style_with_flex_basis}>
212
215
  <%= #{singular}.#{col}%></div>"
213
216
  end
214
217
  when :float
215
218
  width = (limit && limit < 40) ? limit : (40)
216
- "<div class='#{col_identifer}' style='flex-basis: #{perc_width}%'>
219
+ "<div class='#{col_identifer}'#{style_with_flex_basis}>
217
220
  <%= #{singular}.#{col}%></div>"
218
221
  when :string
219
222
  width = (limit && limit < 40) ? limit : (40)
220
- "<div class='#{col_identifer}' style='flex-basis: #{perc_width}%'>
223
+ "<div class='#{col_identifer}'#{style_with_flex_basis} >
221
224
  <%= #{singular}.#{col} %>
222
225
  </div>"
223
226
  when :text
224
- "<div class='#{col_identifer}' style='flex-basis: #{perc_width}%'>
227
+ "<div class='#{col_identifer}'#{style_with_flex_basis}>
225
228
  <%= #{singular}.#{col} %>
226
229
  </div>"
227
230
  when :datetime
228
231
 
229
- "<div class='#{col_identifer}' style='flex-basis: #{perc_width}%'>
232
+ "<div class='#{col_identifer}' #{style_with_flex_basis} >
230
233
  <% unless #{singular}.#{col}.nil? %>
231
234
  <%= #{singular}.#{col}.in_time_zone(current_timezone).strftime('%m/%d/%Y @ %l:%M %p ') + timezonize(current_timezone) %>
232
235
  <% else %>
@@ -234,7 +237,7 @@ module HotGlue
234
237
  <% end %>
235
238
  </div>"
236
239
  when :date
237
- "<div class='#{col_identifer}' style='flex-basis: #{perc_width}%'>
240
+ "<div class='#{col_identifer}' #{style_with_flex_basis} >
238
241
  <% unless #{singular}.#{col}.nil? %>
239
242
  <%= #{singular}.#{col} %>
240
243
  <% else %>
@@ -242,7 +245,7 @@ module HotGlue
242
245
  <% end %>
243
246
  </div>"
244
247
  when :time
245
- "<div class='#{col_identifer}' style='flex-basis: #{perc_width}%'>
248
+ "<div class='#{col_identifer}' #{style_with_flex_basis} >
246
249
  <% unless #{singular}.#{col}.nil? %>
247
250
  <%= #{singular}.#{col}.in_time_zone(current_timezone).strftime('%l:%M %p ') + timezonize(current_timezone) %>
248
251
  <% else %>
@@ -251,7 +254,7 @@ module HotGlue
251
254
  </div>
252
255
  "
253
256
  when :boolean
254
- "<div class='#{col_identifer}' style='flex-basis: #{perc_width}%'>
257
+ "<div class='#{col_identifer}' #{style_with_flex_basis} >
255
258
  <% if #{singular}.#{col}.nil? %>
256
259
  <span class='alert-danger'>MISSING</span>
257
260
  <% elsif #{singular}.#{col} %>
@@ -261,7 +264,7 @@ module HotGlue
261
264
  <% end %>
262
265
  </div>
263
266
  " when :enum
264
- "<div class='#{col_identifer}' style='flex-basis: #{perc_width}%'>
267
+ "<div class='#{col_identifer}' #{style_with_flex_basis} >
265
268
  <% if #{singular}.#{col}.nil? %>
266
269
  <span class='alert-danger'>MISSING</span>
267
270
  <% else %>
@@ -273,8 +276,4 @@ module HotGlue
273
276
  }.join("\n")
274
277
  end
275
278
  end
276
-
277
-
278
-
279
-
280
279
  end
@@ -724,7 +724,8 @@ module HotGlue
724
724
  columns: @columns,
725
725
  show_only: @show_only,
726
726
  singular_class: singular_class,
727
- singular: singular
727
+ singular: singular,
728
+ layout: @layout
728
729
  )
729
730
  end
730
731
 
@@ -4,7 +4,8 @@
4
4
  <% each_downnest_width = @downnest_children.count == 1 ? 33 : (53/@downnest_children.count).floor %>
5
5
 
6
6
  <% @downnest_children.each do |downnest| %>
7
- <div class="<%= @col_identifier %> scaffold-downnest" style="flex-basis: <%= each_downnest_width %>%" >
7
+ <% downnest_style = @layout == "hotglue" ? 'style="flex-basis: ' + each_downnest_width + '%"' : "" %>
8
+ <div class="<%= @col_identifier %> scaffold-downnest" <%= downnest_style %> >
8
9
  <\%= render partial: "<%= namespace_with_trailing_dash %><%= downnest %>/list", locals: {
9
10
  nested_for: "<% if @nested_args.any? %>#{nested_for + "__" if nested_for}<% end %><%= @singular %>-#{<%= @singular %>.id}",
10
11
  <%= @singular %>: <%= @singular %><%= nest_assignments_operator(false, true) %>,
@@ -13,7 +14,8 @@
13
14
  <% end %>
14
15
  <% end %>
15
16
 
16
- <div class="<%= @col_identifier %> scaffold-line-buttons" style="flex-basis: <%= (100 - (column_width * @columns.count)).floor %>%;">
17
+ <% button_style = @layout == "hotglue" ? 'style="flex-basis: ' + (100 - (column_width * @columns.count)).floor + '%;' : "" %>
18
+ <div class="<%= @col_identifier %> scaffold-line-buttons" <%= button_style %>>
17
19
  <% if destroy_action %>
18
20
  <\%= form_with url: <%= path_helper_singular %>(<%= path_helper_args %>), html: {style: "display: inline-block;"}, method: :delete do |f| %>
19
21
  <\%= f.submit "Delete".html_safe, data: <%= delete_confirmation_syntax %>, class: "delete-<%= singular %>-button btn btn-primary btn-sm" %>
@@ -1,3 +1,3 @@
1
1
  module HotGlue
2
- VERSION = '0.3.7'
2
+ VERSION = '0.3.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hot-glue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Fleetwood-Boldt