kuebiko 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.travis.yml +15 -0
- data/Appraisals +15 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +193 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/bin/test +2 -0
- data/gemfiles/rails3.gemfile +7 -0
- data/gemfiles/rails40.gemfile +7 -0
- data/gemfiles/rails41.gemfile +7 -0
- data/gemfiles/rails42.gemfile +7 -0
- data/kuebiko.gemspec +28 -0
- data/lib/generators/rails/templates/url.rb +2 -0
- data/lib/generators/rails/url_generator.rb +11 -0
- data/lib/kuebiko.rb +9 -0
- data/lib/kuebiko/preparation.rb +27 -0
- data/lib/kuebiko/railtie.rb +7 -0
- data/lib/kuebiko/url.rb +49 -0
- data/lib/kuebiko/url/components.rb +44 -0
- data/lib/kuebiko/url/material.rb +18 -0
- data/lib/kuebiko/version.rb +3 -0
- metadata +159 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 37dce4327fc9cd92773f19390c239fd0f80a72c4
|
4
|
+
data.tar.gz: ff6863c24f8d5ebbf1ac79e6ce1c9bfa59bf6b1f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 25aa443874b263a62809dbf9c3005258be1b7f54af5a78e1b8f638b39dc3f141b1c6505b50ccab5ea67b2ad5f70bc5ec5a8321d3bb3f40fcd808da95a11f35f0
|
7
|
+
data.tar.gz: b3df8d3c3a37aaab6db3ca5759ecebcfae1b6268e631b45179ee6d8fdd0d1016f54802eb4b4a59960a49a3ca4b42da38e2fee3c3376e65e2cd86a012e8eca1c3
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- 2.0.0
|
4
|
+
- 2.1
|
5
|
+
- 2.2
|
6
|
+
- ruby-head
|
7
|
+
gemfile:
|
8
|
+
- gemfiles/rails3.gemfile
|
9
|
+
- gemfiles/rails40.gemfile
|
10
|
+
- gemfiles/rails41.gemfile
|
11
|
+
- gemfiles/rails42.gemfile
|
12
|
+
notifications:
|
13
|
+
emails:
|
14
|
+
- tsukasa.oishi@gmail.com
|
15
|
+
before_install: gem install bundler -v 1.10.5
|
data/Appraisals
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
appraise "rails3" do
|
2
|
+
gem "activesupport", "~> 3.2.0"
|
3
|
+
end
|
4
|
+
|
5
|
+
appraise "rails40" do
|
6
|
+
gem "activesupport", "~> 4.0.0"
|
7
|
+
end
|
8
|
+
|
9
|
+
appraise "rails41" do
|
10
|
+
gem "activesupport", "~> 4.1.0"
|
11
|
+
end
|
12
|
+
|
13
|
+
appraise "rails42" do
|
14
|
+
gem "activesupport", "~> 4.2.0"
|
15
|
+
end
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 tsukasaoishi
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,193 @@
|
|
1
|
+
# Kuebiko
|
2
|
+
Kuebiko generates URLs from ruby code.
|
3
|
+
|
4
|
+
[![Build Status](https://travis-ci.org/tsukasaoishi/kuebiko.svg?branch=master)](https://travis-ci.org/tsukasaoishi/kuebiko)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/tsukasaoishi/kuebiko/badges/gpa.svg)](https://codeclimate.com/github/tsukasaoishi/kuebiko)
|
6
|
+
|
7
|
+
![Kuebiko](https://github.com/tsukasaoishi/kuebiko/wiki/images/kuebiko.jpg)
|
8
|
+
|
9
|
+
## Usage
|
10
|
+
URLs generator class inherits Kuebiko::Url.
|
11
|
+
```ruby
|
12
|
+
class ArticleUrl < Kuebiko::Url
|
13
|
+
material :article
|
14
|
+
scheme :http
|
15
|
+
host "kaeruspoon.net"
|
16
|
+
|
17
|
+
def show
|
18
|
+
build "articles", article.title
|
19
|
+
end
|
20
|
+
end
|
21
|
+
```
|
22
|
+
|
23
|
+
You can generate path or URL.
|
24
|
+
```ruby
|
25
|
+
article.title #=> "first_day"
|
26
|
+
|
27
|
+
ArticleUrl.show_path(article) #=> "/articles/first_day"
|
28
|
+
ArticleUrl.show_url(article) #=> "http://kaeruspoon.net/articles/first_day"
|
29
|
+
|
30
|
+
url = ArticleUrl.new(article)
|
31
|
+
url.show_path #=> "/articles/first_day"
|
32
|
+
url.show_url #=> "http://kaeruspoon.net/articles/first_day"
|
33
|
+
```
|
34
|
+
Methods of suffix ```_path``` generate only path.
|
35
|
+
Methods of suffix ```_url``` generate URL.
|
36
|
+
|
37
|
+
```show``` instance method is called from ```show_path``` method (or ```show_url```).
|
38
|
+
|
39
|
+
### Resources that make up URL
|
40
|
+
You can specify name of material. The material name will use as internal accessor name.
|
41
|
+
```ruby
|
42
|
+
class ArticleUrl < Kuebiko::Url
|
43
|
+
material :article
|
44
|
+
|
45
|
+
def hoge
|
46
|
+
build article.title # article is the internal accessor
|
47
|
+
end
|
48
|
+
end
|
49
|
+
```
|
50
|
+
|
51
|
+
You can pass the material object to the initializer or generator class methods.
|
52
|
+
```ruby
|
53
|
+
url = Article.new(article)
|
54
|
+
Article.show_path(article)
|
55
|
+
```
|
56
|
+
The internal accessor returns nil if you do not pass the material object.
|
57
|
+
|
58
|
+
You can specify more than one materials.
|
59
|
+
```ruby
|
60
|
+
class ArticleUrl < Kuebiko::Url
|
61
|
+
material :article, :user
|
62
|
+
end
|
63
|
+
```
|
64
|
+
The order in which you specify the materials will be the order of the objects to pass to the arguments.
|
65
|
+
```ruby
|
66
|
+
url = ArticleUrl.new(article, user)
|
67
|
+
```
|
68
|
+
|
69
|
+
The name ```options``` is reserved as internal accessor.
|
70
|
+
|
71
|
+
### Components of URL
|
72
|
+
You can specify default components.
|
73
|
+
```ruby
|
74
|
+
Kuebiko.default_components(
|
75
|
+
scheme: :https,
|
76
|
+
host: "kaeruspoon.net",
|
77
|
+
port: 443
|
78
|
+
)
|
79
|
+
```
|
80
|
+
The default value of each components are following when you do not specify value.
|
81
|
+
* scheme ```:http```
|
82
|
+
* host ```nil```
|
83
|
+
* port ```nil```
|
84
|
+
|
85
|
+
You can specify several options.
|
86
|
+
```ruby
|
87
|
+
Kuebiko.default_components(
|
88
|
+
host: "kaeruspoon.net",
|
89
|
+
trailing_slash: true
|
90
|
+
)
|
91
|
+
```
|
92
|
+
Generating the URL with trailing slash if ```trailing_slash``` is true.
|
93
|
+
|
94
|
+
You can specify these components and options in Kuebiko::Url class.
|
95
|
+
```ruby
|
96
|
+
class ArticleUrl < Kuebiko::Url
|
97
|
+
scheme :http
|
98
|
+
host "kaeruspoon.net"
|
99
|
+
port 3000
|
100
|
+
trailing_slash true
|
101
|
+
```
|
102
|
+
The value in Kuebiko::Url class overrides the value of Kuebiko.default_components.
|
103
|
+
|
104
|
+
You can specify these components and options at the build method.
|
105
|
+
```ruby
|
106
|
+
class ArticleUrl < Kuebiko::Url
|
107
|
+
def show
|
108
|
+
build "articles", article.title, scheme: :https, host: "a.kaeruspoon.net", port: 1234, trailing_slash: true
|
109
|
+
end
|
110
|
+
end
|
111
|
+
```
|
112
|
+
The value of build method overrides the value of Kuebiko::Url class.
|
113
|
+
|
114
|
+
### Make up the URL
|
115
|
+
The ```build``` method plays the central role to make up URLs.
|
116
|
+
The first part of arguments would become the path of URL. The each arguments would be joined by slash.
|
117
|
+
```ruby
|
118
|
+
class ArticleUrl < Kuebiko::Url
|
119
|
+
def show
|
120
|
+
build "articles", article.title
|
121
|
+
end
|
122
|
+
end
|
123
|
+
```
|
124
|
+
```"articles"``` and ```article.title``` would be joined by slash. The result is "articles/first_day" (article.title is "first_day").
|
125
|
+
The ```show_path``` method returns "/articles/first_day".
|
126
|
+
|
127
|
+
The second part of argument is components and options (see avobe).
|
128
|
+
There are following options in addition to ```trailing_slash```.
|
129
|
+
|
130
|
+
```query``` is used to make up the query string.
|
131
|
+
```ruby
|
132
|
+
build "articles", article.title, query: {special_code: 123}
|
133
|
+
#=> "articles/first_day?special_code=123"
|
134
|
+
```
|
135
|
+
|
136
|
+
```anchor``` is used to add the anchor to the URL.
|
137
|
+
```ruby
|
138
|
+
build "articles", article.title, anchor: "top_navi"
|
139
|
+
#=> "articles/first_day#top_navi"
|
140
|
+
```
|
141
|
+
|
142
|
+
### options internal accessor
|
143
|
+
There is ```options``` internal accessor.
|
144
|
+
```ruby
|
145
|
+
class ArticleUrl < Kuebiko::Url
|
146
|
+
material :article
|
147
|
+
|
148
|
+
def show
|
149
|
+
queries = options.select {|k,v| %i|code mode|.include?(k.to_sym) }
|
150
|
+
build "articles", article.title, query: queries
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
params = {controller: :articles, action: :index, code: "A", hoge: "B"}
|
155
|
+
url = Article.new(article, params)
|
156
|
+
url.show_path #=> "/articles/first_day?code=A"
|
157
|
+
Article.show_path(article, params) #=> "/articles/first_day?code=A"
|
158
|
+
```
|
159
|
+
The arguments after materials arguments become ```options```.
|
160
|
+
|
161
|
+
## Installation
|
162
|
+
|
163
|
+
Add this line to your application's Gemfile:
|
164
|
+
|
165
|
+
```ruby
|
166
|
+
gem 'kuebiko'
|
167
|
+
```
|
168
|
+
|
169
|
+
And then execute:
|
170
|
+
```
|
171
|
+
$ bundle
|
172
|
+
```
|
173
|
+
|
174
|
+
Or install it yourself as:
|
175
|
+
```
|
176
|
+
$ gem install kuebiko
|
177
|
+
```
|
178
|
+
|
179
|
+
## Development
|
180
|
+
|
181
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
182
|
+
|
183
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
184
|
+
|
185
|
+
## Contributing
|
186
|
+
|
187
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/tsukasaoishi/kuebiko. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
188
|
+
|
189
|
+
|
190
|
+
## License
|
191
|
+
|
192
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
193
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "kuebiko"
|
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
ADDED
data/bin/test
ADDED
data/kuebiko.gemspec
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'kuebiko/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "kuebiko"
|
8
|
+
spec.version = Kuebiko::VERSION
|
9
|
+
spec.authors = ["tsukasaoishi"]
|
10
|
+
spec.email = ["tsukasa.oishi@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Kuebiko generates URLs from ruby code.}
|
13
|
+
spec.description = %q{Kuebiko generates URLs from ruby code.}
|
14
|
+
spec.homepage = "https://github.com/tsukasaoishi/kuebiko"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = "exe"
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_dependency "activesupport", ">= 3.2.0", "< 4.3"
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
24
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
25
|
+
spec.add_development_dependency 'appraisal', '~> 2.0'
|
26
|
+
spec.add_development_dependency "minitest"
|
27
|
+
spec.add_development_dependency "minitest-reporters"
|
28
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Rails
|
2
|
+
module Generators
|
3
|
+
class UrlGenerator < Rails::Generators::NamedBase
|
4
|
+
source_root File.expand_path('../templates', __FILE__)
|
5
|
+
|
6
|
+
def create_decorator_file
|
7
|
+
template 'url.rb', File.join('app/urls', class_path, "#{file_name}_url.rb")
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
data/lib/kuebiko.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'cgi'
|
2
|
+
require "active_support/core_ext/object/to_query"
|
3
|
+
require "active_support/core_ext/object/blank"
|
4
|
+
|
5
|
+
module Kuebiko
|
6
|
+
class Preparation
|
7
|
+
attr_reader :scheme, :host, :port
|
8
|
+
|
9
|
+
def initialize(paths, options)
|
10
|
+
@paths = paths
|
11
|
+
@query = options[:query]
|
12
|
+
@anchor = options[:anchor]
|
13
|
+
@trailing_slash = options[:trailing_slash]
|
14
|
+
@scheme = options[:scheme]
|
15
|
+
@host = options[:host]
|
16
|
+
@port = options[:port]
|
17
|
+
end
|
18
|
+
|
19
|
+
def build
|
20
|
+
path = @paths.select{|item| item.present?}.map{|item| CGI.escape(item.to_s)}.join('/')
|
21
|
+
path << "/" if path.present? && @trailing_slash
|
22
|
+
path << "?#{@query.to_query}" if @query.present?
|
23
|
+
path << "##{CGI.escape(@anchor.to_s)}" if @anchor.present?
|
24
|
+
path
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/kuebiko/url.rb
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
require "kuebiko/url/components"
|
2
|
+
require "kuebiko/url/material"
|
3
|
+
require "kuebiko/preparation"
|
4
|
+
|
5
|
+
module Kuebiko
|
6
|
+
class Url
|
7
|
+
def self.method_added(name)
|
8
|
+
return unless public_method_defined?(name)
|
9
|
+
return if /_(path|url)\z/ === name
|
10
|
+
|
11
|
+
class_eval <<-DEF_URL_METHOD, __FILE__, __LINE__ + 1
|
12
|
+
class << self
|
13
|
+
def #{name}_path(*args, **options)
|
14
|
+
new(*args, **options).#{name}_path
|
15
|
+
end
|
16
|
+
|
17
|
+
def #{name}_url(*args, **options)
|
18
|
+
new(*args, **options).#{name}_url
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def #{name}_path(options = {})
|
23
|
+
"/" + #{name}.build
|
24
|
+
end
|
25
|
+
|
26
|
+
def #{name}_url(options = {})
|
27
|
+
url = my_scheme.to_s + "://" + my_host.to_s
|
28
|
+
url << (":" + my_port.to_s) if my_port
|
29
|
+
url + "/" + #{name}.build
|
30
|
+
end
|
31
|
+
DEF_URL_METHOD
|
32
|
+
end
|
33
|
+
|
34
|
+
def initialize(*_, **options)
|
35
|
+
@_options = options
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def build(*paths, **options)
|
41
|
+
options[:trailing_slash] ||= my_trailing_slash
|
42
|
+
Preparation.new(paths, options)
|
43
|
+
end
|
44
|
+
|
45
|
+
def options
|
46
|
+
@_options
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module Kuebiko
|
2
|
+
class Url
|
3
|
+
DEFAULT = {scheme: :http}
|
4
|
+
COMPONENTS = %i|scheme host port trailing_slash|
|
5
|
+
private_constant :DEFAULT, :COMPONENTS
|
6
|
+
|
7
|
+
@@components = {}
|
8
|
+
|
9
|
+
class << self
|
10
|
+
def default_components(options = {})
|
11
|
+
options.each do |comp, value|
|
12
|
+
raise ArgumentError, "unknown components #{comp.inspect}" unless COMPONENTS.include?(comp)
|
13
|
+
instance_eval "#{comp}(value)"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
|
19
|
+
COMPONENTS.each do |config|
|
20
|
+
class_eval <<-DEF_COMP, __FILE__, __LINE__ + 1
|
21
|
+
class << self
|
22
|
+
def #{config}(value)
|
23
|
+
@@components[self] ||= {}
|
24
|
+
@@components[self][:#{config}] = value
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def my_#{config}(klass = self.class)
|
29
|
+
return options[:#{config}] if options.key?(:#{config})
|
30
|
+
|
31
|
+
my_components = (@@components[klass] ||= {})
|
32
|
+
if my_components.key?(:#{config})
|
33
|
+
my_components[:#{config}]
|
34
|
+
elsif klass == ::Kuebiko::Url
|
35
|
+
DEFAULT[:#{config}]
|
36
|
+
else
|
37
|
+
my_#{config}(self.class.superclass)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
private :my_#{config}
|
41
|
+
DEF_COMP
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Kuebiko
|
2
|
+
class Url
|
3
|
+
class << self
|
4
|
+
def material(*names)
|
5
|
+
class_eval <<-DEF_INIT, __FILE__, __LINE__ + 1
|
6
|
+
def initialize(*materials, **options)
|
7
|
+
#{names.map{|n| "@_#{n}"}.join(", ")}, _dust = materials
|
8
|
+
@_options = options
|
9
|
+
end
|
10
|
+
|
11
|
+
#{names.map{|n| "def #{n}; @_#{n}; end"}.join("\n")}
|
12
|
+
private #{names.map{|n| ":#{n}"}.join(", ")}
|
13
|
+
DEF_INIT
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
metadata
ADDED
@@ -0,0 +1,159 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: kuebiko
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- tsukasaoishi
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-08-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 3.2.0
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '4.3'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 3.2.0
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '4.3'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: bundler
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '1.10'
|
40
|
+
type: :development
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '1.10'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rake
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '10.0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '10.0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: appraisal
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '2.0'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '2.0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: minitest
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: minitest-reporters
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
description: Kuebiko generates URLs from ruby code.
|
104
|
+
email:
|
105
|
+
- tsukasa.oishi@gmail.com
|
106
|
+
executables: []
|
107
|
+
extensions: []
|
108
|
+
extra_rdoc_files: []
|
109
|
+
files:
|
110
|
+
- ".gitignore"
|
111
|
+
- ".travis.yml"
|
112
|
+
- Appraisals
|
113
|
+
- CODE_OF_CONDUCT.md
|
114
|
+
- Gemfile
|
115
|
+
- LICENSE.txt
|
116
|
+
- README.md
|
117
|
+
- Rakefile
|
118
|
+
- bin/console
|
119
|
+
- bin/setup
|
120
|
+
- bin/test
|
121
|
+
- gemfiles/rails3.gemfile
|
122
|
+
- gemfiles/rails40.gemfile
|
123
|
+
- gemfiles/rails41.gemfile
|
124
|
+
- gemfiles/rails42.gemfile
|
125
|
+
- kuebiko.gemspec
|
126
|
+
- lib/generators/rails/templates/url.rb
|
127
|
+
- lib/generators/rails/url_generator.rb
|
128
|
+
- lib/kuebiko.rb
|
129
|
+
- lib/kuebiko/preparation.rb
|
130
|
+
- lib/kuebiko/railtie.rb
|
131
|
+
- lib/kuebiko/url.rb
|
132
|
+
- lib/kuebiko/url/components.rb
|
133
|
+
- lib/kuebiko/url/material.rb
|
134
|
+
- lib/kuebiko/version.rb
|
135
|
+
homepage: https://github.com/tsukasaoishi/kuebiko
|
136
|
+
licenses:
|
137
|
+
- MIT
|
138
|
+
metadata: {}
|
139
|
+
post_install_message:
|
140
|
+
rdoc_options: []
|
141
|
+
require_paths:
|
142
|
+
- lib
|
143
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
144
|
+
requirements:
|
145
|
+
- - ">="
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: '0'
|
148
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
requirements: []
|
154
|
+
rubyforge_project:
|
155
|
+
rubygems_version: 2.4.8
|
156
|
+
signing_key:
|
157
|
+
specification_version: 4
|
158
|
+
summary: Kuebiko generates URLs from ruby code.
|
159
|
+
test_files: []
|