demeler 1.0.5 → 1.0.6

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
  SHA1:
3
- metadata.gz: 728592cb4a1c887e39d1fc9a66bc1e1d6a609538
4
- data.tar.gz: 3c37351fbb3c337e85d3121fa6f031b61524090b
3
+ metadata.gz: a350b5f6a09823e9fed7af88bb7184c3e3dc3826
4
+ data.tar.gz: fdad247bf7ba8c9d72fe829e1406e1d54f094399
5
5
  SHA512:
6
- metadata.gz: 8c5d91aca641ac66bbda90b50488b88faae5d0cd0df1511d6d4ae5877c61a82c54aebcfc2cc5e350cd90aa9f9ab8a50a1f34a07088370a35076b6dc3e7e80ee0
7
- data.tar.gz: ebe33bd9e0d9640a7eab8297bde1c133d6f1acd0a265c41f0ff284d338ab05c8e123b71f0eccbf9bf99ca9678fdbecca8f35c68dc0d20a38d4b63ad11946a81d
6
+ metadata.gz: b94943dcc4d271876540dd8198e459405faffa16d7fbac91f8d4eb468c567e6eb3f3d516a0019baffc328c63a65ad405761ba8b6d9802da1a9bafd2582d8dee2
7
+ data.tar.gz: 593ce1b7bdbe6337e52b8ab1d7b326970a5578e4bcbe81f5da014ff03f4eda45502ba44267923eaa00679e92b6fec04e1daa34002ca7b89daf14276ca95dd928
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.0.6
2
+
3
+ * Added a `reset` shortcut that works like the `submit` shortcut.
4
+
1
5
  # 1.0.5
2
6
 
3
7
  * Had to eliminate a "side effect" by cloning the :href string before using it.
data/README.md CHANGED
@@ -88,7 +88,7 @@ There are three variables you'll be interested in in Demeler.
88
88
 
89
89
  * `obj` The object, if any, that was passed as parameter 1 in `new` or `build`. I talk a little more about that one below.
90
90
  * `usr` The object, if any, that was passed as parameter 3 in `build` or parameter 2 in `new`. This object can be anything you need access to in the Demeler script. If you need to pass several objects, simply put them into an array or hash and pass that.
91
- * `out` This is an array where the intermediate results are held internally. To convert the array onto a String, use `to_s` or `to_html` if you created the Demeler object with `new`, and set parameter 2 to false or true if you used `build`.
91
+ * `out` This is an array where the intermediate results are held internally. To convert the array onto a String, use `to_s` or `to_html` if you created the Demeler object with `new`; set parameter 2 to false or true if you used `build`.
92
92
 
93
93
  For example,
94
94
 
@@ -127,8 +127,6 @@ The output is
127
127
  <!-- end generated output -->
128
128
  ```
129
129
 
130
- Note that the array is named `data` outside of Demeler, but once it's passed in through parameter 3 (usr) of `build`, inside Demeler it's name is `usr`.
131
-
132
130
  ## Fields from an object can be inserted automatically
133
131
 
134
132
  First, a word of warning: if you use variables other than those below, you script will crash. If your script crashes, don't blame Demeler first; look in your script for variables that shouldn't be there.
@@ -436,6 +434,15 @@ values | Hash | The names and values of the radio boxes.
436
434
 
437
435
  The data value in the form object may be a String, Array or Hash. If this is a string, the values are comma separated. If this is an array, the elements are the values. If this is a hash, the values (right hand side of each pair) are the values.
438
436
 
437
+ ### def reset(text, opts={})
438
+
439
+ The reset shortcut creates a `input` control of type 'reset'.
440
+
441
+ Name | Type | Value
442
+ ---- | ---- | -----
443
+ text | String | The text displayed on the face of the button.
444
+ opts | Hash | The attributes and options for the control.
445
+
439
446
  ### def select(name, opts, values)
440
447
 
441
448
  The select control is unique in that it has `select` tags surrounding a list of `option` tags. Based on the attributes (opts), you can create a pure dropdown list, or a scrolling list. See https://www.w3schools.com for more info on HTML.
data/lib/demeler.rb CHANGED
@@ -223,6 +223,22 @@ class Demeler
223
223
  end
224
224
  end
225
225
 
226
+ ##
227
+ # The reset shortcut
228
+ #
229
+ # @param [String] text The text which the button will display
230
+ # @param [Hash] opts Options for the RESET statement
231
+ #
232
+ # @example
233
+ # g.reset("Reset", {})
234
+ #
235
+ def reset(text, opts={})
236
+ attr = {:type=>:reset}
237
+ attr[:value] = text
238
+ attr.merge!(opts)
239
+ tag_generator(:input, attr)
240
+ end
241
+
226
242
  ##
227
243
  # The select (select_tag) shortcut
228
244
  #
@@ -1,4 +1,4 @@
1
1
  module Version
2
- VERSION = "1.0.5"
3
- MODIFIED = "2017-06-17"
2
+ VERSION = "1.0.6"
3
+ MODIFIED = "2017-06-23"
4
4
  end
data/notes CHANGED
@@ -37,7 +37,7 @@ git push -u origin master
37
37
  #----------------------------------------
38
38
 
39
39
  # To upload the gem to rubygems.org
40
- gem push demeler-1.0.4.gem
40
+ gem push demeler-1.0.6.gem
41
41
 
42
42
  sudo gem install demeler
43
43
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: demeler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael J. Welch, Ph.D.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-17 00:00:00.000000000 Z
11
+ date: 2017-06-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This gem takes your ruby input, plus an object such as a Sequel::Model
14
14
  object, and generates HTML code. If the object has values, they're inserted into