hanami-helpers 0.0.0 → 0.3.0

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.
@@ -0,0 +1,52 @@
1
+ module Hanami
2
+ module Helpers
3
+ # Routing helper for full stack Hanami web applications.
4
+ #
5
+ # For a given application called <tt>Web::Application</tt>, at runtime
6
+ # Hanami creates a routes factory called <tt>Web::Routes</tt>.
7
+ #
8
+ # By including this module in a view, it makes that factory avaliable as
9
+ # <tt>routes</tt>.
10
+ #
11
+ # @since 0.1.0
12
+ #
13
+ # @example Basic usage in template
14
+ # require 'hanami'
15
+ #
16
+ # module Web::Views::Home
17
+ # class Index
18
+ # include Web::View
19
+ # end
20
+ # end
21
+ #
22
+ # # ERB template
23
+ # # <%= routes.home_path %>
24
+ #
25
+ # @example Basic usage in view
26
+ # require 'hanami'
27
+ #
28
+ # module Web::Views::Home
29
+ # class Index
30
+ # include Web::View
31
+ #
32
+ # def link_to_home
33
+ # %(<a href="#{ routes.home_path }">Home</a>)
34
+ # end
35
+ # end
36
+ # end
37
+ #
38
+ # # ERB template
39
+ # # <%= link_to_home %>
40
+ module RoutingHelper
41
+ def self.included(base)
42
+ factory = "#{ Utils::String.new(base).namespace }::Routes"
43
+
44
+ base.class_eval <<-END_EVAL, __FILE__, __LINE__
45
+ def routes
46
+ #{ factory }
47
+ end
48
+ END_EVAL
49
+ end
50
+ end
51
+ end
52
+ end
@@ -1,5 +1,8 @@
1
1
  module Hanami
2
2
  module Helpers
3
- VERSION = "0.0.0"
3
+ # Define version
4
+ #
5
+ # @since 0.1.0
6
+ VERSION = '0.3.0'.freeze
4
7
  end
5
8
  end
metadata CHANGED
@@ -1,29 +1,45 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanami-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Guidi
8
+ - Trung Lê
9
+ - Alfonso Uceda
8
10
  autorequire:
9
- bindir: exe
11
+ bindir: bin
10
12
  cert_chain: []
11
- date: 2016-01-20 00:00:00.000000000 Z
13
+ date: 2016-01-22 00:00:00.000000000 Z
12
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: hanami-utils
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - "~>"
20
+ - !ruby/object:Gem::Version
21
+ version: '0.7'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - "~>"
27
+ - !ruby/object:Gem::Version
28
+ version: '0.7'
13
29
  - !ruby/object:Gem::Dependency
14
30
  name: bundler
15
31
  requirement: !ruby/object:Gem::Requirement
16
32
  requirements:
17
33
  - - "~>"
18
34
  - !ruby/object:Gem::Version
19
- version: '1.11'
35
+ version: '1.6'
20
36
  type: :development
21
37
  prerelease: false
22
38
  version_requirements: !ruby/object:Gem::Requirement
23
39
  requirements:
24
40
  - - "~>"
25
41
  - !ruby/object:Gem::Version
26
- version: '1.11'
42
+ version: '1.6'
27
43
  - !ruby/object:Gem::Dependency
28
44
  name: rake
29
45
  requirement: !ruby/object:Gem::Requirement
@@ -38,24 +54,53 @@ dependencies:
38
54
  - - "~>"
39
55
  - !ruby/object:Gem::Version
40
56
  version: '10.0'
41
- description: Hanami is a web framework for Ruby
57
+ - !ruby/object:Gem::Dependency
58
+ name: minitest
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - "~>"
62
+ - !ruby/object:Gem::Version
63
+ version: '5.5'
64
+ type: :development
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - "~>"
69
+ - !ruby/object:Gem::Version
70
+ version: '5.5'
71
+ description: View helpers for Ruby applications
42
72
  email:
43
73
  - me@lucaguidi.com
74
+ - trung.le@ruby-journal.com
75
+ - uceda73@gmail.com
44
76
  executables: []
45
77
  extensions: []
46
78
  extra_rdoc_files: []
47
79
  files:
48
- - ".gitignore"
49
- - Gemfile
80
+ - CHANGELOG.md
81
+ - LICENSE.md
50
82
  - README.md
51
- - Rakefile
52
- - bin/console
53
- - bin/setup
54
83
  - hanami-helpers.gemspec
84
+ - lib/hanami-helpers.rb
55
85
  - lib/hanami/helpers.rb
86
+ - lib/hanami/helpers/escape_helper.rb
87
+ - lib/hanami/helpers/form_helper.rb
88
+ - lib/hanami/helpers/form_helper/form_builder.rb
89
+ - lib/hanami/helpers/form_helper/html_node.rb
90
+ - lib/hanami/helpers/form_helper/values.rb
91
+ - lib/hanami/helpers/html_helper.rb
92
+ - lib/hanami/helpers/html_helper/empty_html_node.rb
93
+ - lib/hanami/helpers/html_helper/html_builder.rb
94
+ - lib/hanami/helpers/html_helper/html_fragment.rb
95
+ - lib/hanami/helpers/html_helper/html_node.rb
96
+ - lib/hanami/helpers/html_helper/text_node.rb
97
+ - lib/hanami/helpers/link_to_helper.rb
98
+ - lib/hanami/helpers/number_formatting_helper.rb
99
+ - lib/hanami/helpers/routing_helper.rb
56
100
  - lib/hanami/helpers/version.rb
57
101
  homepage: http://hanamirb.org
58
- licenses: []
102
+ licenses:
103
+ - MIT
59
104
  metadata: {}
60
105
  post_install_message:
61
106
  rdoc_options: []
@@ -65,7 +110,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
65
110
  requirements:
66
111
  - - ">="
67
112
  - !ruby/object:Gem::Version
68
- version: '0'
113
+ version: 2.0.0
69
114
  required_rubygems_version: !ruby/object:Gem::Requirement
70
115
  requirements:
71
116
  - - ">="
@@ -76,5 +121,6 @@ rubyforge_project:
76
121
  rubygems_version: 2.5.1
77
122
  signing_key:
78
123
  specification_version: 4
79
- summary: The web, with simplicity
124
+ summary: Hanami helpers
80
125
  test_files: []
126
+ has_rdoc:
data/.gitignore DELETED
@@ -1,9 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in hanami-helpers.gemspec
4
- gemspec
data/Rakefile DELETED
@@ -1,2 +0,0 @@
1
- require "bundler/gem_tasks"
2
- task :default => :spec
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "hanami/helpers"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here