required_files 0.2.6
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 +14 -0
- data/.rspec +2 -0
- data/.travis.yml +3 -0
- data/Capfile +33 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +39 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/config/deploy.rb +51 -0
- data/config/deploy/production.rb +61 -0
- data/config/deploy/staging.rb +61 -0
- data/exe/required_files +3 -0
- data/lib/required_files.rb +157 -0
- data/lib/required_files/get.rb +35 -0
- data/lib/required_files/make.rb +12 -0
- data/lib/required_files/make/meta_class.rb +20 -0
- data/lib/required_files/make/txt.rb +13 -0
- data/lib/required_files/version.rb +3 -0
- data/required_files.gemspec +39 -0
- data/~/.gem/credentials +2 -0
- metadata +151 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ca5868b98227731c791371dc8937105fa8751e35
|
4
|
+
data.tar.gz: 057c9062cc946510fb26f1eacac1e024fe6e95e4
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d77815cdd7fb7b8b44e865e7434cdce1ae84012f50b3f581d2fa9326b48f1c7f5dc826501b4b8931c588f45eeb994102127cf8bbc64d82f5141e9afc37232e7c
|
7
|
+
data.tar.gz: 29899e590d25e500a2ef593d52d0c35399a5dd697d643268c872aa8c37075db869493413475f7ff6b2f51355fd455795551b8ac7bd3b4c472b15c05f7d9ef0d9
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Capfile
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# Load DSL and set up stages
|
2
|
+
require 'capistrano/setup'
|
3
|
+
|
4
|
+
# Include default deployment tasks
|
5
|
+
require 'capistrano/deploy'
|
6
|
+
|
7
|
+
require 'deplo'
|
8
|
+
|
9
|
+
# Include tasks from other gems included in your Gemfile
|
10
|
+
#
|
11
|
+
# For documentation on these, see for example:
|
12
|
+
#
|
13
|
+
# https://github.com/capistrano/rvm
|
14
|
+
# https://github.com/capistrano/rbenv
|
15
|
+
# https://github.com/capistrano/chruby
|
16
|
+
# https://github.com/capistrano/bundler
|
17
|
+
# https://github.com/capistrano/rails
|
18
|
+
# https://github.com/capistrano/passenger
|
19
|
+
#
|
20
|
+
# require 'capistrano/rvm'
|
21
|
+
# require 'capistrano/rbenv'
|
22
|
+
# require 'capistrano/chruby'
|
23
|
+
# require 'capistrano/bundler'
|
24
|
+
# require 'capistrano/rails/assets'
|
25
|
+
# require 'capistrano/rails/migrations'
|
26
|
+
# require 'capistrano/passenger'
|
27
|
+
|
28
|
+
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
|
29
|
+
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
|
30
|
+
|
31
|
+
Rake::Task[:production].invoke
|
32
|
+
invoke :production
|
33
|
+
set_cap_tasks_from_deplo
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Shu Fujita
|
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 all
|
13
|
+
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 THE
|
21
|
+
SOFTWARE.
|
22
|
+
|
data/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# RequiredFiles
|
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/required_files`. 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 'required_files'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install required_files
|
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. Then, run `bin/console` for an interactive prompt that will allow you to experiment. Run `bundle exec required_files` to use the code located in this directory, ignoring other installed copies of this gem.
|
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` to 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
|
+
1. Fork it ( https://github.com/[my-github-username]/required_files/fork )
|
36
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
37
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
38
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
39
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "required_files"
|
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/config/deploy.rb
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# config valid only for current version of Capistrano
|
2
|
+
lock '3.4.0'
|
3
|
+
|
4
|
+
set :application, 'gem_required_files'
|
5
|
+
set :repo_url, 'https://github.com/osorubeki-fujita/required_files.git'
|
6
|
+
|
7
|
+
set :pj_dir , ::File.expand_path( "#{ ::File.dirname( __FILE__ ) }/.." )
|
8
|
+
set :github_remote_name , :origin
|
9
|
+
|
10
|
+
# Default branch is :master
|
11
|
+
# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
|
12
|
+
|
13
|
+
# Default deploy_to directory is /var/www/my_app_name
|
14
|
+
set :deploy_to, '/'
|
15
|
+
|
16
|
+
# Default value for :scm is :git
|
17
|
+
# set :scm, :git
|
18
|
+
|
19
|
+
# Default value for :format is :pretty
|
20
|
+
# set :format, :pretty
|
21
|
+
|
22
|
+
# Default value for :log_level is :debug
|
23
|
+
# set :log_level, :debug
|
24
|
+
|
25
|
+
# Default value for :pty is false
|
26
|
+
# set :pty, true
|
27
|
+
|
28
|
+
# Default value for :linked_files is []
|
29
|
+
# set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml')
|
30
|
+
|
31
|
+
# Default value for linked_dirs is []
|
32
|
+
# set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system')
|
33
|
+
|
34
|
+
# Default value for default_env is {}
|
35
|
+
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
|
36
|
+
|
37
|
+
# Default value for keep_releases is 5
|
38
|
+
# set :keep_releases, 5
|
39
|
+
|
40
|
+
namespace :deploy do
|
41
|
+
|
42
|
+
after :restart, :clear_cache do
|
43
|
+
on roles(:web), in: :groups, limit: 3, wait: 10 do
|
44
|
+
# Here we can do anything such as:
|
45
|
+
# within release_path do
|
46
|
+
# execute :rake, 'cache:clear'
|
47
|
+
# end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# server-based syntax
|
2
|
+
# ======================
|
3
|
+
# Defines a single server with a list of roles and multiple properties.
|
4
|
+
# You can define all roles on a single server, or split them:
|
5
|
+
|
6
|
+
# server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value
|
7
|
+
# server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value
|
8
|
+
# server 'db.example.com', user: 'deploy', roles: %w{db}
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
# role-based syntax
|
13
|
+
# ==================
|
14
|
+
|
15
|
+
# Defines a role with one or multiple servers. The primary server in each
|
16
|
+
# group is considered to be the first unless any hosts have the primary
|
17
|
+
# property set. Specify the username and a domain or IP for the server.
|
18
|
+
# Don't use `:all`, it's a meta role.
|
19
|
+
|
20
|
+
# role :app, %w{deploy@example.com}, my_property: :my_value
|
21
|
+
# role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value
|
22
|
+
# role :db, %w{deploy@example.com}
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
# Configuration
|
27
|
+
# =============
|
28
|
+
# You can set any configuration variable like in config/deploy.rb
|
29
|
+
# These variables are then only loaded and set in this stage.
|
30
|
+
# For available Capistrano configuration variables see the documentation page.
|
31
|
+
# http://capistranorb.com/documentation/getting-started/configuration/
|
32
|
+
# Feel free to add new variables to customise your setup.
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
# Custom SSH Options
|
37
|
+
# ==================
|
38
|
+
# You may pass any option but keep in mind that net/ssh understands a
|
39
|
+
# limited set of options, consult the Net::SSH documentation.
|
40
|
+
# http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start
|
41
|
+
#
|
42
|
+
# Global options
|
43
|
+
# --------------
|
44
|
+
# set :ssh_options, {
|
45
|
+
# keys: %w(/home/rlisowski/.ssh/id_rsa),
|
46
|
+
# forward_agent: false,
|
47
|
+
# auth_methods: %w(password)
|
48
|
+
# }
|
49
|
+
#
|
50
|
+
# The server-based syntax can be used to override options:
|
51
|
+
# ------------------------------------
|
52
|
+
# server 'example.com',
|
53
|
+
# user: 'user_name',
|
54
|
+
# roles: %w{web app},
|
55
|
+
# ssh_options: {
|
56
|
+
# user: 'user_name', # overrides user setting above
|
57
|
+
# keys: %w(/home/user_name/.ssh/id_rsa),
|
58
|
+
# forward_agent: false,
|
59
|
+
# auth_methods: %w(publickey password)
|
60
|
+
# # password: 'please use keys'
|
61
|
+
# }
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# server-based syntax
|
2
|
+
# ======================
|
3
|
+
# Defines a single server with a list of roles and multiple properties.
|
4
|
+
# You can define all roles on a single server, or split them:
|
5
|
+
|
6
|
+
# server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value
|
7
|
+
# server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value
|
8
|
+
# server 'db.example.com', user: 'deploy', roles: %w{db}
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
# role-based syntax
|
13
|
+
# ==================
|
14
|
+
|
15
|
+
# Defines a role with one or multiple servers. The primary server in each
|
16
|
+
# group is considered to be the first unless any hosts have the primary
|
17
|
+
# property set. Specify the username and a domain or IP for the server.
|
18
|
+
# Don't use `:all`, it's a meta role.
|
19
|
+
|
20
|
+
# role :app, %w{deploy@example.com}, my_property: :my_value
|
21
|
+
# role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value
|
22
|
+
# role :db, %w{deploy@example.com}
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
# Configuration
|
27
|
+
# =============
|
28
|
+
# You can set any configuration variable like in config/deploy.rb
|
29
|
+
# These variables are then only loaded and set in this stage.
|
30
|
+
# For available Capistrano configuration variables see the documentation page.
|
31
|
+
# http://capistranorb.com/documentation/getting-started/configuration/
|
32
|
+
# Feel free to add new variables to customise your setup.
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
# Custom SSH Options
|
37
|
+
# ==================
|
38
|
+
# You may pass any option but keep in mind that net/ssh understands a
|
39
|
+
# limited set of options, consult the Net::SSH documentation.
|
40
|
+
# http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start
|
41
|
+
#
|
42
|
+
# Global options
|
43
|
+
# --------------
|
44
|
+
# set :ssh_options, {
|
45
|
+
# keys: %w(/home/rlisowski/.ssh/id_rsa),
|
46
|
+
# forward_agent: false,
|
47
|
+
# auth_methods: %w(password)
|
48
|
+
# }
|
49
|
+
#
|
50
|
+
# The server-based syntax can be used to override options:
|
51
|
+
# ------------------------------------
|
52
|
+
# server 'example.com',
|
53
|
+
# user: 'user_name',
|
54
|
+
# roles: %w{web app},
|
55
|
+
# ssh_options: {
|
56
|
+
# user: 'user_name', # overrides user setting above
|
57
|
+
# keys: %w(/home/user_name/.ssh/id_rsa),
|
58
|
+
# forward_agent: false,
|
59
|
+
# auth_methods: %w(publickey password)
|
60
|
+
# # password: 'please use keys'
|
61
|
+
# }
|
data/exe/required_files
ADDED
@@ -0,0 +1,157 @@
|
|
1
|
+
require "required_files/version"
|
2
|
+
|
3
|
+
require "required_files/get"
|
4
|
+
require "required_files/make"
|
5
|
+
require "required_files/make/meta_class"
|
6
|
+
require "required_files/make/txt"
|
7
|
+
|
8
|
+
require "yaml"
|
9
|
+
|
10
|
+
module RequiredFiles
|
11
|
+
|
12
|
+
class MetaClass
|
13
|
+
|
14
|
+
def initialize( set_all_files_under_the_top_namespace: true )
|
15
|
+
@array = ::Array.new
|
16
|
+
@set_all_files_under_the_top_namespace = set_all_files_under_the_top_namespace
|
17
|
+
set_array
|
18
|
+
end
|
19
|
+
|
20
|
+
attr_reader :array
|
21
|
+
alias :files :array
|
22
|
+
alias :required_files :array
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def set_all_files_under_the_top_namespace?
|
27
|
+
@set_all_files_under_the_top_namespace
|
28
|
+
end
|
29
|
+
|
30
|
+
def set_array
|
31
|
+
set_top_file
|
32
|
+
set_other_files
|
33
|
+
set_all_files_under_the_top_namespace
|
34
|
+
end
|
35
|
+
|
36
|
+
def set_top_file
|
37
|
+
_ignored_files = ignored_files
|
38
|
+
_top_file = top_file
|
39
|
+
unless _ignored_files.present? and _ignored_files.include?( _top_file )
|
40
|
+
@array << _top_file
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def set_other_files
|
45
|
+
_ignored_files = ignored_files
|
46
|
+
_other_files = other_files
|
47
|
+
if _other_files.present?
|
48
|
+
_other_files.each do | file |
|
49
|
+
unless _ignored_files.present? and _ignored_files.include?( file )
|
50
|
+
set_files( file )
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def set_all_files_under_the_top_namespace
|
57
|
+
if set_all_files_under_the_top_namespace?
|
58
|
+
_ignored_files = ignored_files
|
59
|
+
all_files_under_the_top_namespace.each do | file |
|
60
|
+
unless _ignored_files.present? and _ignored_files.include?( file )
|
61
|
+
@array << file
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def set_files( *files )
|
68
|
+
files.flatten.each do | file |
|
69
|
+
filename_without_extension = file.gsub( /\.rb\Z/ , "" )
|
70
|
+
filename_with_extension = filename_without_extension + ".rb"
|
71
|
+
if ::File.exist?( filename_with_extension ) and !( @array.include?( filename_without_extension ) )
|
72
|
+
@array << filename_without_extension
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def set_files_starting_with( *dir_root )
|
78
|
+
set_files( self.class.files_starting_with( *dir_root ) )
|
79
|
+
end
|
80
|
+
|
81
|
+
[ :top_file , :all_files_under_the_top_namespace ].each do | class_method_name |
|
82
|
+
eval <<-DEF
|
83
|
+
def #{ class_method_name }
|
84
|
+
self.class.#{ class_method_name }
|
85
|
+
end
|
86
|
+
DEF
|
87
|
+
end
|
88
|
+
|
89
|
+
def other_files
|
90
|
+
other_or_ignored_files( self.class.other_files )
|
91
|
+
end
|
92
|
+
|
93
|
+
def ignored_files
|
94
|
+
other_or_ignored_files( self.class.ignored_files )
|
95
|
+
end
|
96
|
+
|
97
|
+
def other_or_ignored_files( files )
|
98
|
+
if files.present?
|
99
|
+
[ files ].flatten
|
100
|
+
else
|
101
|
+
nil
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
def self.files
|
106
|
+
self.new.files
|
107
|
+
end
|
108
|
+
|
109
|
+
def self.top_file
|
110
|
+
if settings_for_auto_loading.present?
|
111
|
+
used_part_of_namespace = name.gsub( /\A#{ settings_for_auto_loading[ :namespace ].name }/ , "" ).split( "::" ).map( &:underscore )
|
112
|
+
::File.join( settings_for_auto_loading[ :filename ] , *used_part_of_namespace )
|
113
|
+
else
|
114
|
+
raise "This method \'#{self.name}.#{ __method__ }\' is not defined yet."
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
def self.other_files
|
119
|
+
nil
|
120
|
+
end
|
121
|
+
|
122
|
+
def self.ignored_files
|
123
|
+
nil
|
124
|
+
end
|
125
|
+
|
126
|
+
def self.all_files_in_the_same_directory
|
127
|
+
::Dir.glob( "#{ top_file }/**.rb" ).sort
|
128
|
+
end
|
129
|
+
|
130
|
+
def self.all_files_under_the_top_namespace
|
131
|
+
::Dir.glob( "#{ top_file }/**/**.rb" ).sort
|
132
|
+
end
|
133
|
+
|
134
|
+
def self.files_not_be_required
|
135
|
+
( all_files_under_the_top_namespace.map { | str | str.gsub( /\.rb\Z/ , "" ) } - required_files.map { | str | str.gsub( /\.rb\Z/ , "" ) } ).sort
|
136
|
+
end
|
137
|
+
|
138
|
+
def self.files_starting_with( *dir_root )
|
139
|
+
d_root = dir_root.flatten
|
140
|
+
[ ::File.join( *dir_root ) ] + ::Dir.glob( "#{ d_root.join( "/" ) }/**/**.rb" ).sort
|
141
|
+
end
|
142
|
+
|
143
|
+
class << self
|
144
|
+
|
145
|
+
alias :required_files :files
|
146
|
+
|
147
|
+
private
|
148
|
+
|
149
|
+
def settings_for_auto_loading
|
150
|
+
nil
|
151
|
+
end
|
152
|
+
|
153
|
+
end
|
154
|
+
|
155
|
+
end
|
156
|
+
|
157
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module RequiredFiles::Get
|
2
|
+
|
3
|
+
def self.from_txt( top_dir , filename = "required_files" )
|
4
|
+
::File.open( "#{ top_dir }/#{ filename }.txt" , "r:utf-8" ).read.split( /\n/ ).map { |f| "#{ top_dir }/#{ f }" }
|
5
|
+
end
|
6
|
+
|
7
|
+
=begin
|
8
|
+
def self.from_yaml( top_dir , filename = "required_files" )
|
9
|
+
::YAML.load_file( "#{ top_dir }/#{ filename }.yaml" ).map { | key , value |
|
10
|
+
from_hash( key , value )
|
11
|
+
}
|
12
|
+
end
|
13
|
+
|
14
|
+
class << self
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def from_hash( key , value )
|
19
|
+
ary = ::Array.new
|
20
|
+
if value.instance_of?( ::Array ) or value.instance_of?( ::String )
|
21
|
+
[ value ].flatten.each do | element |
|
22
|
+
ary << "#{ key }/#{ element }"
|
23
|
+
end
|
24
|
+
elsif value.instance_of?( ::Hash )
|
25
|
+
value.each do |k,v|
|
26
|
+
ary << "#{ key }/#{ from_hash(k,v) }"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
ary
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
=end
|
34
|
+
|
35
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module RequiredFiles::Make
|
2
|
+
|
3
|
+
# [ :txt , :yaml ].each do | file_type |
|
4
|
+
[ :txt ].each do | file_type |
|
5
|
+
eval <<-DEF
|
6
|
+
def self.#{ file_type }( required_files , top_dir , filename = "required_files" )
|
7
|
+
#{ file_type.capitalize }.new( required_files , top_dir , filename ).generate_file
|
8
|
+
end
|
9
|
+
DEF
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class RequiredFiles::Make::MetaClass
|
2
|
+
|
3
|
+
def initialize( file_type , required_files , top_dir , filename = "required_files" )
|
4
|
+
@file_type = file_type
|
5
|
+
@required_files = required_files
|
6
|
+
@top_dir = top_dir
|
7
|
+
@filename = filename
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def filename_including_dir
|
13
|
+
"#{ @top_dir }/#{ @filename }.#{ @file_type }"
|
14
|
+
end
|
15
|
+
|
16
|
+
def actually_required_files
|
17
|
+
@required_files.map { | str | str.gsub( "#{ @top_dir }/" , "" ) + ".rb" }
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class RequiredFiles::Make::Txt < RequiredFiles::Make::MetaClass
|
2
|
+
|
3
|
+
def initialize( required_files , top_dir , filename = "required_files" )
|
4
|
+
super( "txt" , required_files , top_dir , filename = "required_files" )
|
5
|
+
end
|
6
|
+
|
7
|
+
def generate_file
|
8
|
+
::File.open( filename_including_dir , "w:utf-8" ) do |f|
|
9
|
+
f.print actually_required_files.join( "\n" )
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'required_files/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "required_files"
|
8
|
+
spec.version = RequiredFiles::VERSION
|
9
|
+
spec.authors = ["Shu Fujita"]
|
10
|
+
spec.email = ["osorubeki.fujita@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = "This gem provides library for making list of required files."
|
13
|
+
# spec.description = %q{TODO: Write a longer description or delete this line.}
|
14
|
+
spec.homepage = "https://github.com/osorubeki-fujita/required_files"
|
15
|
+
|
16
|
+
spec.license = "MIT"
|
17
|
+
|
18
|
+
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
19
|
+
# delete this section to allow pushing this gem to any host.
|
20
|
+
# if spec.respond_to?(:metadata)
|
21
|
+
# spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
22
|
+
# else
|
23
|
+
# raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
24
|
+
# end
|
25
|
+
|
26
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
27
|
+
spec.bindir = "exe"
|
28
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
29
|
+
spec.require_paths = ["lib"]
|
30
|
+
|
31
|
+
spec.add_development_dependency "bundler", "~> 1.9"
|
32
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
33
|
+
spec.add_development_dependency "rspec"
|
34
|
+
|
35
|
+
spec.add_development_dependency "capistrano"
|
36
|
+
spec.add_development_dependency "deplo", ">= 0.1.4"
|
37
|
+
|
38
|
+
spec.add_runtime_dependency "activesupport" , ">= 4.2.1"
|
39
|
+
end
|
data/~/.gem/credentials
ADDED
metadata
ADDED
@@ -0,0 +1,151 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: required_files
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.6
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Shu Fujita
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-05-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.9'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.9'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
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
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: capistrano
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: "deplo\x81"
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.1.4
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.1.4
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: activesupport
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 4.2.1
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 4.2.1
|
97
|
+
description:
|
98
|
+
email:
|
99
|
+
- osorubeki.fujita@gmail.com
|
100
|
+
executables:
|
101
|
+
- required_files
|
102
|
+
extensions: []
|
103
|
+
extra_rdoc_files: []
|
104
|
+
files:
|
105
|
+
- ".gitignore"
|
106
|
+
- ".rspec"
|
107
|
+
- ".travis.yml"
|
108
|
+
- Capfile
|
109
|
+
- Gemfile
|
110
|
+
- LICENSE
|
111
|
+
- README.md
|
112
|
+
- Rakefile
|
113
|
+
- bin/console
|
114
|
+
- bin/setup
|
115
|
+
- config/deploy.rb
|
116
|
+
- config/deploy/production.rb
|
117
|
+
- config/deploy/staging.rb
|
118
|
+
- exe/required_files
|
119
|
+
- lib/required_files.rb
|
120
|
+
- lib/required_files/get.rb
|
121
|
+
- lib/required_files/make.rb
|
122
|
+
- lib/required_files/make/meta_class.rb
|
123
|
+
- lib/required_files/make/txt.rb
|
124
|
+
- lib/required_files/version.rb
|
125
|
+
- required_files.gemspec
|
126
|
+
- "~/.gem/credentials"
|
127
|
+
homepage: https://github.com/osorubeki-fujita/required_files
|
128
|
+
licenses:
|
129
|
+
- MIT
|
130
|
+
metadata: {}
|
131
|
+
post_install_message:
|
132
|
+
rdoc_options: []
|
133
|
+
require_paths:
|
134
|
+
- lib
|
135
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ">="
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
140
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0'
|
145
|
+
requirements: []
|
146
|
+
rubyforge_project:
|
147
|
+
rubygems_version: 2.4.5
|
148
|
+
signing_key:
|
149
|
+
specification_version: 4
|
150
|
+
summary: This gem provides library for making list of required files.
|
151
|
+
test_files: []
|