todofuken 0.1.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.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/Gemfile +4 -0
- data/README.md +36 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/generators/todofuken/install/install_generator.rb +69 -0
- data/lib/todofuken.rb +5 -0
- data/lib/todofuken/version.rb +3 -0
- data/todofuken.gemspec +26 -0
- metadata +96 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: fd13205eb0584cc412b1f6fe9b1b114d6934b831
|
4
|
+
data.tar.gz: 11084a2ffce7dbce0584a1251244cb976d6c16a6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 44cd6b1fef798da6c5c4a642562dfa7d6379c4908a1d0abedbf04e9305c7e612f25e36682a1b0a7eda289ed1af8706e9aa7f8797c175f6048a2c45c29ae0ef21
|
7
|
+
data.tar.gz: a0afa508e2349a860055c869426424baf93954492265bfe30046b8ae2c94429325f17c7c3310e6c7481852c511341d7429f69d25a96daf6e1c05fe007d7bbb08
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# Todofuken
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/todofuken`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'todofuken'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install todofuken
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
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).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/todofuken.
|
36
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "todofuken"
|
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
@@ -0,0 +1,69 @@
|
|
1
|
+
require 'rails'
|
2
|
+
|
3
|
+
class Todofuken::InstallGenerator < Rails::Generators::NamedBase
|
4
|
+
source_root File.expand_path("../templates", __FILE__)
|
5
|
+
|
6
|
+
Prefectures = %w[
|
7
|
+
北海道
|
8
|
+
青森県
|
9
|
+
岩手県
|
10
|
+
宮城県
|
11
|
+
秋田県
|
12
|
+
山形県
|
13
|
+
福島県
|
14
|
+
茨城県
|
15
|
+
栃木県
|
16
|
+
群馬県
|
17
|
+
埼玉県
|
18
|
+
千葉県
|
19
|
+
東京都
|
20
|
+
神奈川県
|
21
|
+
新潟県
|
22
|
+
富山県
|
23
|
+
石川県
|
24
|
+
福井県
|
25
|
+
山梨県
|
26
|
+
長野県
|
27
|
+
岐阜県
|
28
|
+
静岡県
|
29
|
+
愛知県
|
30
|
+
三重県
|
31
|
+
滋賀県
|
32
|
+
京都府
|
33
|
+
大阪府
|
34
|
+
兵庫県
|
35
|
+
奈良県
|
36
|
+
和歌山県
|
37
|
+
鳥取県
|
38
|
+
島根県
|
39
|
+
岡山県
|
40
|
+
広島県
|
41
|
+
山口県
|
42
|
+
徳島県
|
43
|
+
香川県
|
44
|
+
愛媛県
|
45
|
+
高知県
|
46
|
+
福岡県
|
47
|
+
佐賀県
|
48
|
+
長崎県
|
49
|
+
熊本県
|
50
|
+
大分県
|
51
|
+
宮崎県
|
52
|
+
鹿児島県
|
53
|
+
沖縄県
|
54
|
+
].freeze
|
55
|
+
|
56
|
+
|
57
|
+
def create_migration
|
58
|
+
generate 'model', "#{class_name} name:string --no-timestamps"
|
59
|
+
end
|
60
|
+
|
61
|
+
def create_db_seed
|
62
|
+
text = "\n\n"
|
63
|
+
text << Prefectures.map.with_index(1) do |name, idx|
|
64
|
+
"#{class_name}.find_or_create_by(id: #{idx}, name: '#{name}')"
|
65
|
+
end.join("\n")
|
66
|
+
|
67
|
+
inject_into_file 'db/seeds.rb', text.force_encoding('ascii-8bit'), after: /.\Z/
|
68
|
+
end
|
69
|
+
end
|
data/lib/todofuken.rb
ADDED
data/todofuken.gemspec
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'todofuken/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "todofuken"
|
8
|
+
spec.version = Todofuken::VERSION
|
9
|
+
spec.authors = ["Masataka Kuwabara"]
|
10
|
+
spec.email = ["p.ck.t22@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Create a master table of Japanese Prefectures for Rails}
|
13
|
+
spec.description = %q{Create a master table of Japanese Prefectures for Rails}
|
14
|
+
spec.homepage = "https://github.com/pocke/todofuken"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
spec.bindir = "exe"
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
spec.license = 'CC0-1.0'
|
21
|
+
|
22
|
+
spec.add_runtime_dependency 'rails', '>= 4.0.0'
|
23
|
+
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.11"
|
25
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: todofuken
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Masataka Kuwabara
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-04-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 4.0.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 4.0.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.11'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.11'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
description: Create a master table of Japanese Prefectures for Rails
|
56
|
+
email:
|
57
|
+
- p.ck.t22@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- Gemfile
|
64
|
+
- README.md
|
65
|
+
- Rakefile
|
66
|
+
- bin/console
|
67
|
+
- bin/setup
|
68
|
+
- lib/generators/todofuken/install/install_generator.rb
|
69
|
+
- lib/todofuken.rb
|
70
|
+
- lib/todofuken/version.rb
|
71
|
+
- todofuken.gemspec
|
72
|
+
homepage: https://github.com/pocke/todofuken
|
73
|
+
licenses:
|
74
|
+
- CC0-1.0
|
75
|
+
metadata: {}
|
76
|
+
post_install_message:
|
77
|
+
rdoc_options: []
|
78
|
+
require_paths:
|
79
|
+
- lib
|
80
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0'
|
85
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
requirements: []
|
91
|
+
rubyforge_project:
|
92
|
+
rubygems_version: 2.5.1
|
93
|
+
signing_key:
|
94
|
+
specification_version: 4
|
95
|
+
summary: Create a master table of Japanese Prefectures for Rails
|
96
|
+
test_files: []
|