fugleman 0.1.6 → 0.1.7

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: 73c3ad2ea7d52eecda0540ab8dd83caafcf1c97c
4
- data.tar.gz: 6dd0ba68a547b4f56fe51100c146be393375aa55
3
+ metadata.gz: a8b7f9e029866e00952688f6a4697d18557bb341
4
+ data.tar.gz: 63a88f5893751c3328215c044cbf79672397d161
5
5
  SHA512:
6
- metadata.gz: a516e4bac574cb274ee711532109e82b5dcfa9a27466d46ae6a17f3e3a2048354022c4add16d49a3883eb8d345d665dccd112f221c0feceea4db13e6995a39c2
7
- data.tar.gz: 7688d44b1d9381a14f204f227020552998880aa6d053fa7cb92b78d48a075a0427f6fb37cba54dcb59471a8b5223d893d27a840141d52e319f2e9a2ab5883ea4
6
+ metadata.gz: cd28d509534bb598f526d0a78f2dd7b3f1c07eaae0395d04ddf0ecf80bc9e8d3dff4882d1366fc55318273825e66824be7ea027cac600cbbc3f24cd3b7371ad3
7
+ data.tar.gz: ebe8debf2c22042ff4f929b77037697cb427a17d6d371a65cf6da3addc44597fbf8e5b2c51d5b37a6a445a69debad882a679d8ae9cca80c0ce3f21e9ce4b2f43
data/README CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- # SYNOPSIS
2
+ SYNOPSIS
3
3
 
4
4
  HTML helper code. But simpler.
5
5
 
@@ -13,7 +13,15 @@ HTML helper code. But simpler.
13
13
  input_tag :text, :foo # => <input type="text" name="foo" />
14
14
  ...
15
15
 
16
- # LICENSING
16
+ RATIONALE
17
+
18
+ Padrino disturbed our zen. Now we set things right. This lib contains the bare
19
+ minimum for web application development without the conveniences.
20
+
21
+ And if you say that we're bound to become big, you underestimate our need for
22
+ simplicity.
23
+
24
+ LICENSING
17
25
 
18
26
  Some of the code in here started its life out as part of padrino-helpers. It
19
27
  was then copied and heavily modified. This means that we take the blame for
data/fugleman.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "fugleman"
5
- s.version = "0.1.6"
5
+ s.version = "0.1.7"
6
6
  s.summary = "Helpers and stuff for working with sinatra. Really simple."
7
7
  s.homepage = "https://bitbucket.org/technologyastronauts/fugleman"
8
8
  s.authors = ['Kaspar Schiess']
@@ -1,5 +1,4 @@
1
1
 
2
-
3
2
  module Fugleman
4
3
  class Namespace
5
4
  attr_reader :path
@@ -15,13 +14,25 @@ class Namespace
15
14
  @context.input_tag type, full_name(name), opts
16
15
  end
17
16
 
17
+ def checkbox name, opts={}
18
+ input_tag :checkbox, name, '', {
19
+ placeholder: nil,
20
+ class: nil,
21
+ value: 'true',
22
+ checked: value(name) }.merge(opts)
23
+ end
24
+ def textarea name, opts={}
25
+ @context.content_tag :textarea,
26
+ @context.h(value(name)), {
27
+ name: full_name(name) }.merge(opts)
28
+ end
29
+
18
30
  def full_name something
19
31
  @path.to_s + "[#{something}]"
20
32
  end
21
33
  def value name
22
- if @obj.respond_to? name
23
- return @obj.send(name)
24
- end
34
+ return nil unless @obj
35
+ return @obj.send(name)
25
36
  end
26
37
  end
27
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fugleman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaspar Schiess
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-03 00:00:00.000000000 Z
11
+ date: 2014-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack