put_rake 0.1.0 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0bdc26fb3302434f8fae5d42728f84c8ae7d77d9497f9482c7ffaa7b733e7f83
4
- data.tar.gz: f40573fc250f03733f2a25ab5df4adae05f83ce969b2b37a520818fef5606f6a
3
+ metadata.gz: d5dfaaa375b4a3fcb639e8af684476bd5694f8b7c675a955d14d2f88037f7b98
4
+ data.tar.gz: f28cfda8ba1c625c3b5cd4c037a125b0f4785bb2924183904a830f83ae807387
5
5
  SHA512:
6
- metadata.gz: 74accb32cfd3dd76b7e7a2a7456c873e720a64ef73b6796e577b8a0ccc461d65ccd3a7cb3f22c86b911d95919e90c7d648847aa98a8d2e34399fa9eb9c85f2d9
7
- data.tar.gz: a6a0800fc45d6ffc3d0b0f8c2c96b2b2b94852975d0c7f6436b645c744a60e718a299db9425f3a96aa880c987253fb71175d0918a2f15d63cdb995dfad9671fa
6
+ metadata.gz: dc40a566ebc2824ed94723a7af046c08e88b499c5f78a8eea1c955449a09cf499283ca2b0c2393bfc7c501dc9f22c1a705adb76283c9fdc318886fae62f95a51
7
+ data.tar.gz: f6bc94d4eca5b6b31120136e27363e8db55a71c9918d129b0008cbc5f4cada39c6fada71235790c7ac6440c809094575f79801720a3d9e82abf27509b716f340
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- put_rake (0.1.0)
4
+ put_rake (0.1.1)
5
5
  colorize
6
6
  command_line
7
7
  thor
data/README.org ADDED
@@ -0,0 +1,73 @@
1
+ * PutRake
2
+ :PROPERTIES:
3
+ :CUSTOM_ID: putrake
4
+ :END:
5
+ Put the Rakefile on the local directory
6
+
7
+ ** Installation
8
+ :PROPERTIES:
9
+ :CUSTOM_ID: installation
10
+ :END:
11
+ Install the gem and add to the application's Gemfile by executing:
12
+
13
+ #+begin_example
14
+ $ bundle add put_rake
15
+ #+end_example
16
+
17
+ If bundler is not being used to manage dependencies, install the gem by
18
+ executing:
19
+
20
+ #+begin_example
21
+ $ gem install put_rake
22
+ #+end_example
23
+
24
+ ** Usage
25
+ :PROPERTIES:
26
+ :CUSTOM_ID: usage
27
+ :END:
28
+
29
+ #+begin_src bash
30
+ put_rake commands:
31
+ put_rake for [EXT] # put Rakefile for [EXT]
32
+ put_rake help [COMMAND] # Describe available commands or one specific command
33
+ put_rake list # list available Rakefiles
34
+ put_rake version # show version
35
+ #+end_src
36
+
37
+ ** Development
38
+ :PROPERTIES:
39
+ :CUSTOM_ID: development
40
+ :END:
41
+
42
+ To install this gem onto your local machine, run
43
+ =bundle exec rake install=. To release a new version, update the version
44
+ number in =version.rb=, and then run =bundle exec rake release=, which
45
+ will create a git tag for the version, push git commits and the created
46
+ tag, and push the =.gem= file to [[https://rubygems.org][rubygems.org]].
47
+
48
+ ** Contributing
49
+ :PROPERTIES:
50
+ :CUSTOM_ID: contributing
51
+ :END:
52
+ Bug reports and pull requests are welcome on GitHub at
53
+ https://github.com/daddygongon/put_rake. This project is intended to be a
54
+ safe, welcoming space for collaboration, and contributors are expected
55
+ to adhere to the
56
+ [[https://github.com/%5BUSERNAME%5D/put_rake/blob/main/CODE_OF_CONDUCT.md][code
57
+ of conduct]].
58
+
59
+ ** License
60
+ :PROPERTIES:
61
+ :CUSTOM_ID: license
62
+ :END:
63
+ The gem is available as open source under the terms of the
64
+ [[https://opensource.org/licenses/MIT][MIT License]].
65
+
66
+ ** Code of Conduct
67
+ :PROPERTIES:
68
+ :CUSTOM_ID: code-of-conduct
69
+ :END:
70
+ Everyone interacting in the PutRake project's codebases, issue trackers,
71
+ chat rooms and mailing lists is expected to follow the
72
+ [[https://github.com/%5BUSERNAME%5D/put_rake/blob/main/CODE_OF_CONDUCT.md][code
73
+ of conduct]].
data/Rakefile CHANGED
@@ -28,5 +28,3 @@ task :git_auto do
28
28
  puts res.stdout.green
29
29
  end
30
30
  end
31
-
32
-
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PutRake
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
data/lib/put_rake.rb CHANGED
@@ -1,12 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
  require "thor"
3
3
  require "fileutils"
4
- require "pp"
5
- require "yaml"
6
- require "command_line/global"
7
4
 
8
5
  require_relative "put_rake/version"
9
6
  #require_relative "put_rake/cli"
7
+ # https://github.com/rails/thor/wiki
8
+
10
9
  module PutRake
11
10
  class Error < StandardError; end
12
11
  # Your code goes here...
@@ -22,15 +21,27 @@ module PutRake
22
21
  end
23
22
 
24
23
  desc "for [EXT]", "put Rakefile for [EXT]"
24
+ method_option :force, :type => :boolean, :default => false,
25
+ :aliases => "-f", :desc => "forcely replace"
26
+ # method_option :force => false, :aliases => "-f", :desc => "forcely replace"
27
+ method_option :add, :type => :boolean, :default => false,
28
+ :aliases => "-a", :desc => "add to the Rakefile"
25
29
  def for(*args)
26
30
  gem_template_dir = File.join(File.dirname(__FILE__), 'templates')
27
31
  file = "Rakefile_#{args[0]}"
28
32
  if File.exists?("./Rakefile")
29
- puts "Rakefile exists."
33
+ if options[:force]
34
+ comm = "cp #{File.join(gem_template_dir,file)} ./Rakefile"
35
+ elsif options[:add]
36
+ comm = "cat #{File.join(gem_template_dir,file)} >> ./Rakefile"
37
+ else
38
+ comm = "echo 'Rakefile exists. -f(orce) or -a(dd) available.'"
39
+ end
30
40
  else
31
41
  comm = "cp #{File.join(gem_template_dir,file)} ./Rakefile"
32
- system comm
33
42
  end
43
+ puts comm
44
+ system comm
34
45
  end
35
46
 
36
47
  desc "list", "list available Rakefiles"
data/put_rake.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.license = "MIT"
14
14
  spec.required_ruby_version = ">= 2.6.0"
15
15
 
16
- spec.metadata["source_code_uri"] = "https://github.com/daddygonogon/put_rake"
16
+ spec.metadata["source_code_uri"] = "https://github.com/daddygongon/put_rake"
17
17
 
18
18
  # Specify which files should be added to the gem when it is released.
19
19
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: put_rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shigeto R. Nishiani
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-12 00:00:00.000000000 Z
11
+ date: 2023-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -80,7 +80,7 @@ files:
80
80
  - Gemfile
81
81
  - Gemfile.lock
82
82
  - LICENSE.txt
83
- - README.md
83
+ - README.org
84
84
  - Rakefile
85
85
  - exe/put_rake
86
86
  - lib/put_rake.rb
@@ -92,7 +92,7 @@ homepage:
92
92
  licenses:
93
93
  - MIT
94
94
  metadata:
95
- source_code_uri: https://github.com/daddygonogon/put_rake
95
+ source_code_uri: https://github.com/daddygongon/put_rake
96
96
  post_install_message:
97
97
  rdoc_options: []
98
98
  require_paths:
data/README.md DELETED
@@ -1,37 +0,0 @@
1
- # PutRake
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/put_rake`. 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
- Install the gem and add to the application's Gemfile by executing:
10
-
11
- $ bundle add put_rake
12
-
13
- If bundler is not being used to manage dependencies, install the gem by executing:
14
-
15
- $ gem install put_rake
16
-
17
- ## Usage
18
-
19
- TODO: Write usage instructions here
20
-
21
- ## Development
22
-
23
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
24
-
25
- 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 the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
26
-
27
- ## Contributing
28
-
29
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/put_rake. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/put_rake/blob/main/CODE_OF_CONDUCT.md).
30
-
31
- ## License
32
-
33
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
34
-
35
- ## Code of Conduct
36
-
37
- Everyone interacting in the PutRake project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/put_rake/blob/main/CODE_OF_CONDUCT.md).