fugleman 0.1.7 → 0.1.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
  SHA1:
3
- metadata.gz: a8b7f9e029866e00952688f6a4697d18557bb341
4
- data.tar.gz: 63a88f5893751c3328215c044cbf79672397d161
3
+ metadata.gz: cb05dbbe0db4898cb38c986d39a3408ca7591c59
4
+ data.tar.gz: 0d73a301df08f4bcc22118b30eb98d6408706f03
5
5
  SHA512:
6
- metadata.gz: cd28d509534bb598f526d0a78f2dd7b3f1c07eaae0395d04ddf0ecf80bc9e8d3dff4882d1366fc55318273825e66824be7ea027cac600cbbc3f24cd3b7371ad3
7
- data.tar.gz: ebe8debf2c22042ff4f929b77037697cb427a17d6d371a65cf6da3addc44597fbf8e5b2c51d5b37a6a445a69debad882a679d8ae9cca80c0ce3f21e9ce4b2f43
6
+ metadata.gz: 5d8eb64a8a0acfb8581715e3d86e5a1e669b2fe6fcb90bc2cb9927fa5a08fac517d5d693d4133405db8105e2939fe2fe4be0dc242e0608c475d1ea9e8060ff7a
7
+ data.tar.gz: 3ab54a00f1abd5f4bd369ddc91fc8005953c17f08d881654b158612d6e213fa8443c6b336c18f145350289b25f0557ee003135f347e1301fd46cb9774bd1eafe
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
@@ -0,0 +1,27 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ fugleman (0.1.7)
5
+ rack
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ae (1.8.2)
11
+ ansi
12
+ ansi (1.4.3)
13
+ brass (1.2.1)
14
+ facets (2.9.3)
15
+ qed (2.9.1)
16
+ ansi
17
+ brass
18
+ facets (>= 2.8)
19
+ rack (1.5.2)
20
+
21
+ PLATFORMS
22
+ ruby
23
+
24
+ DEPENDENCIES
25
+ ae
26
+ fugleman!
27
+ qed
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "fugleman"
5
- s.version = "0.1.7"
5
+ s.version = "0.1.8"
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']
@@ -21,4 +21,7 @@ EOF
21
21
  s.require_paths = ["lib"]
22
22
 
23
23
  s.add_runtime_dependency 'rack'
24
+
25
+ s.add_development_dependency 'ae'
26
+ s.add_development_dependency 'qed'
24
27
  end
@@ -8,6 +8,16 @@ require 'fugleman/namespace'
8
8
  #
9
9
  module Fugleman::Helpers
10
10
 
11
+ def extract_options! args
12
+ peek = args.last
13
+
14
+ if peek.kind_of? Hash
15
+ return args.pop
16
+ end
17
+
18
+ Hash.new
19
+ end
20
+
11
21
  # -------------------------------------------------------------- form creation
12
22
 
13
23
  def form_namespace path, obj=nil, &block
@@ -19,12 +29,12 @@ module Fugleman::Helpers
19
29
  # Creates a link element with given name, url and options.
20
30
  #
21
31
  def link_to(*args, &block)
22
- options = args.extract_options!
32
+ options = extract_options!(args)
23
33
  name = block_given? ? '' : args.shift
24
34
 
25
35
 
26
36
  url = args.first || '#'
27
- options.reverse_merge!(:href => url)
37
+ options = {href: url}.merge(options)
28
38
 
29
39
  block_given? ? content_tag(:a, options, &block) : content_tag(:a, name, options)
30
40
  end
@@ -68,7 +78,7 @@ module Fugleman::Helpers
68
78
  def javascript_include_tag(*sources)
69
79
  options = {
70
80
  :type => 'text/javascript'
71
- }.update(sources.extract_options!.symbolize_keys)
81
+ }.update(extract_options!(sources).symbolize_keys)
72
82
  sources.flatten.inject(String.new) do |all,source|
73
83
  all << content_tag(:script, nil, { :src => asset_path('javascripts/'+source+'.js') }.update(options))
74
84
  end
@@ -0,0 +1,3 @@
1
+
2
+ require 'ae'
3
+ require 'fugleman'
@@ -0,0 +1,15 @@
1
+
2
+ # Fugleman Helpers
3
+
4
+ To use Fugleman helpers, you have to include them into your Sinatra application.
5
+
6
+ ~~~ruby
7
+ include Fugleman::Helpers
8
+ ~~~
9
+
10
+ Fugleman helpers generate stuff for your Sinatra app that you need anyway. For example, it helps you with link generation.
11
+
12
+ ~~~ruby
13
+ link = link_to 'Text', 'test.html'
14
+ link.assert == '<a href="test.html">Text</a>'
15
+ ~~~
metadata CHANGED
@@ -1,27 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fugleman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
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-06 00:00:00.000000000 Z
11
+ date: 2014-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: ae
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: qed
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
25
53
  - !ruby/object:Gem::Version
26
54
  version: '0'
27
55
  description: "HTML and other helper functions, for working with sinatra. Except simple.
@@ -33,12 +61,16 @@ executables: []
33
61
  extensions: []
34
62
  extra_rdoc_files: []
35
63
  files:
36
- - LICENSE
37
- - README
38
64
  - fugleman.gemspec
39
- - lib/fugleman.rb
65
+ - Gemfile
66
+ - Gemfile.lock
40
67
  - lib/fugleman/helpers.rb
41
68
  - lib/fugleman/namespace.rb
69
+ - lib/fugleman.rb
70
+ - LICENSE
71
+ - qed/applique/fugleman.rb
72
+ - qed/helpers.md
73
+ - README
42
74
  homepage: https://bitbucket.org/technologyastronauts/fugleman
43
75
  licenses: []
44
76
  metadata: {}
@@ -48,19 +80,18 @@ require_paths:
48
80
  - lib
49
81
  required_ruby_version: !ruby/object:Gem::Requirement
50
82
  requirements:
51
- - - ">="
83
+ - - '>='
52
84
  - !ruby/object:Gem::Version
53
85
  version: '0'
54
86
  required_rubygems_version: !ruby/object:Gem::Requirement
55
87
  requirements:
56
- - - ">="
88
+ - - '>='
57
89
  - !ruby/object:Gem::Version
58
90
  version: '0'
59
91
  requirements: []
60
92
  rubyforge_project:
61
- rubygems_version: 2.2.2
93
+ rubygems_version: 2.0.14
62
94
  signing_key:
63
95
  specification_version: 4
64
96
  summary: Helpers and stuff for working with sinatra. Really simple.
65
97
  test_files: []
66
- has_rdoc: