bundlegem 0.0.4 → 0.0.5
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 +4 -4
- data/bin/bundlegem +4 -7
- data/changelog +10 -0
- data/lib/bundlegem/cli/gem.rb +10 -9
- data/lib/bundlegem/version.rb +1 -1
- data/lib/bundlegem.rb +7 -0
- data/spec/bundlegem_spec.rb +6 -0
- data/tmp_gem/.gitignore +9 -0
- data/tmp_gem/.rspec +2 -0
- data/tmp_gem/.travis.yml +3 -0
- data/tmp_gem/Gemfile +4 -0
- data/tmp_gem/README.md +39 -0
- data/tmp_gem/Rakefile +1 -0
- data/tmp_gem/bin/console +14 -0
- data/tmp_gem/changelog +7 -0
- data/tmp_gem/lib/tmp_gem/version.rb +3 -0
- data/tmp_gem/lib/tmp_gem.rb +5 -0
- data/tmp_gem/spec/spec_helper.rb +2 -0
- data/tmp_gem/spec/tmp_gem_spec.rb +11 -0
- data/tmp_gem/tmp_gem.gemspec +27 -0
- metadata +14 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c08c0682db8e699b13f7f117349b7c7da714ede
|
4
|
+
data.tar.gz: 5c15178fe7fb6594e6fead96bedc15c63b6f978e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5dcd12a40000b95ade8a289fbcceb95e1798f2709cb5fa25510d0e1a26d439ea4df72a04857b7fc9f5a5c857c14f7b9abeaeee80f05c7c198eeb6cd5fc204bc9
|
7
|
+
data.tar.gz: 02a40f796bac379663fb5580c995acb5f9709011c38fff1e94ecc715165fd70ee61159f7279f911d40e3b21f370ac6cfce548daf108b6e77e68610fbc376fd60
|
data/bin/bundlegem
CHANGED
@@ -5,8 +5,6 @@ Signal.trap("INT") { exit 1 }
|
|
5
5
|
require 'bundler'
|
6
6
|
require 'bundlegem'
|
7
7
|
# require 'bundlergem/friendly_errors'
|
8
|
-
require 'bundlegem/cli'
|
9
|
-
require 'bundlegem/cli/gem'
|
10
8
|
|
11
9
|
if ARGV.length < 1
|
12
10
|
puts "error: you need to specify a gemname at least"
|
@@ -42,18 +40,17 @@ end
|
|
42
40
|
|
43
41
|
|
44
42
|
options = {"bin"=>false, "ext"=>false, :coc=> false}
|
45
|
-
|
43
|
+
gem_name = ARGV[0] # gem name
|
46
44
|
|
47
45
|
if ARGV.length > 1
|
48
|
-
if ARGV[1] != "-t"
|
49
|
-
puts "you can ONLY use -t as an argument
|
46
|
+
if ARGV[1] != "-t" and ARGV[1] != "--template"
|
47
|
+
puts "you can ONLY use -t as an argument because I'm quite busy and should be doing something else right now!"
|
50
48
|
exit 1
|
51
49
|
end
|
52
50
|
|
53
51
|
options.merge!({"template" => ARGV[2]})
|
54
52
|
end
|
55
53
|
|
56
|
-
|
57
|
-
Bundlegem::CLI::Gem.new(options, name, self).run
|
54
|
+
Bundlegem.gem(options, gem_name)
|
58
55
|
|
59
56
|
|
data/changelog
CHANGED
@@ -12,8 +12,18 @@
|
|
12
12
|
new template
|
13
13
|
- Behavior: gems in the ~/.bundlegem/gem_templates folder take precidence over
|
14
14
|
built in gems? ...add prompt
|
15
|
+
- Cleaning: Make create_gem build a string instead of puts so
|
16
|
+
output can be squelched for testing
|
15
17
|
|
16
18
|
|
19
|
+
** 0.0.5 **
|
20
|
+
- Bug in 0.0.3 that broke building template gems fixed
|
21
|
+
* Template Directories part of code was being skipped for built in templates, but not all of it
|
22
|
+
- Bug where sub directories were not being explicitly created
|
23
|
+
- Added integration test just to make sure the built-in templates can be generated without problems
|
24
|
+
- Cleaned up internal API and how the binary works
|
25
|
+
|
26
|
+
|
17
27
|
** 0.0.4 **
|
18
28
|
- Tell the user what files are being created
|
19
29
|
- Created config['git_repo_url'] variable to be used in templates
|
data/lib/bundlegem/cli/gem.rb
CHANGED
@@ -3,12 +3,11 @@ require 'pry'
|
|
3
3
|
|
4
4
|
module Bundlegem
|
5
5
|
class CLI::Gem
|
6
|
-
attr_reader :options, :gem_name, :
|
6
|
+
attr_reader :options, :gem_name, :name, :target
|
7
7
|
|
8
|
-
def initialize(options, gem_name
|
8
|
+
def initialize(options, gem_name)
|
9
9
|
@options = options
|
10
10
|
@gem_name = resolve_name(gem_name)
|
11
|
-
@thor = thor
|
12
11
|
|
13
12
|
@name = @gem_name
|
14
13
|
@target = Pathname.pwd.join(gem_name)
|
@@ -125,10 +124,12 @@ module Bundlegem
|
|
125
124
|
# Bundler.ui.info "Initializing git repo in #{target}"
|
126
125
|
Dir.chdir(target) { `git init`; `git add .` }
|
127
126
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
127
|
+
# Disabled thanks to removal of thor, might not be helpful...
|
128
|
+
#if options[:edit]
|
129
|
+
# # Open gemspec in editor
|
130
|
+
#
|
131
|
+
# # thor.run("#{options["edit"]} \"#{target.join("#{name}.gemspec")}\"")
|
132
|
+
#end
|
132
133
|
|
133
134
|
puts "\nComplete."
|
134
135
|
end
|
@@ -136,12 +137,12 @@ module Bundlegem
|
|
136
137
|
private
|
137
138
|
|
138
139
|
def dynamically_generate_template_directories
|
139
|
-
return nil if options["template"].nil?
|
140
|
+
# return nil if options["template"].nil?
|
140
141
|
|
141
142
|
template_src = get_template_src
|
142
143
|
|
143
144
|
template_dirs = {}
|
144
|
-
Dir.glob("#{template_src}
|
145
|
+
Dir.glob("#{template_src}/**/*").each do |f|
|
145
146
|
next unless File.directory? f
|
146
147
|
base_path = f[template_src.length+1..-1]
|
147
148
|
template_dirs.merge!(base_path => base_path.gsub('#{name}', "#{name}") )
|
data/lib/bundlegem/version.rb
CHANGED
data/lib/bundlegem.rb
CHANGED
@@ -24,6 +24,13 @@ module Bundlegem
|
|
24
24
|
output_string
|
25
25
|
end
|
26
26
|
|
27
|
+
def gem(options, gem_name)
|
28
|
+
require 'bundlegem/cli'
|
29
|
+
require 'bundlegem/cli/gem'
|
30
|
+
|
31
|
+
Bundlegem::CLI::Gem.new(options, gem_name).run
|
32
|
+
end
|
33
|
+
|
27
34
|
# input: [ { "predefined" => "default" },
|
28
35
|
# { "MISC" => "my_thing" },
|
29
36
|
# { "prdefined" => "service" }
|
data/spec/bundlegem_spec.rb
CHANGED
@@ -32,4 +32,10 @@ describe Bundlegem do
|
|
32
32
|
expect(list_output.include?(category)).to be true
|
33
33
|
end
|
34
34
|
|
35
|
+
it "can generate the built-in gems fine" do
|
36
|
+
options = {"bin"=>false, "ext"=>false, :coc=> false}
|
37
|
+
gem_name = "tmp_gem" # gem name
|
38
|
+
Bundlegem.gem(options, gem_name)
|
39
|
+
end
|
40
|
+
|
35
41
|
end
|
data/tmp_gem/.gitignore
ADDED
data/tmp_gem/.rspec
ADDED
data/tmp_gem/.travis.yml
ADDED
data/tmp_gem/Gemfile
ADDED
data/tmp_gem/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# TmpGem
|
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/tmp_gem`. 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 'tmp_gem'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install tmp_gem
|
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.
|
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]/tmp_gem/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/tmp_gem/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/tmp_gem/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "tmp_gem"
|
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/tmp_gem/changelog
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'tmp_gem/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "tmp_gem"
|
8
|
+
spec.version = TmpGem::VERSION
|
9
|
+
spec.authors = ["TODO: Write your name"]
|
10
|
+
spec.email = ["TODO: Write your email address"]
|
11
|
+
|
12
|
+
spec.summary = %q{TODO: Write a short summary, because Rubygems requires one.}
|
13
|
+
spec.description = %q{TODO: delete this line since you're in a hurry.}
|
14
|
+
spec.homepage = "https://github.com/TODO: Write your name/tmp_gem"
|
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
|
+
|
21
|
+
if spec.respond_to?(:metadata)
|
22
|
+
spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com' to prevent pushes to rubygems.org, or delete to allow pushes to any server."
|
23
|
+
end
|
24
|
+
|
25
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
26
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
27
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bundlegem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TheNotary
|
@@ -143,6 +143,19 @@ files:
|
|
143
143
|
- lib/bundlegem/version.rb
|
144
144
|
- spec/bundlegem_spec.rb
|
145
145
|
- spec/spec_helper.rb
|
146
|
+
- tmp_gem/.gitignore
|
147
|
+
- tmp_gem/.rspec
|
148
|
+
- tmp_gem/.travis.yml
|
149
|
+
- tmp_gem/Gemfile
|
150
|
+
- tmp_gem/README.md
|
151
|
+
- tmp_gem/Rakefile
|
152
|
+
- tmp_gem/bin/console
|
153
|
+
- tmp_gem/changelog
|
154
|
+
- tmp_gem/lib/tmp_gem.rb
|
155
|
+
- tmp_gem/lib/tmp_gem/version.rb
|
156
|
+
- tmp_gem/spec/spec_helper.rb
|
157
|
+
- tmp_gem/spec/tmp_gem_spec.rb
|
158
|
+
- tmp_gem/tmp_gem.gemspec
|
146
159
|
homepage: ''
|
147
160
|
licenses:
|
148
161
|
- MIT
|