creategem 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -7
- data/lib/creategem/cli.rb +9 -11
- data/lib/creategem/git.rb +1 -1
- data/lib/creategem/repository.rb +2 -1
- data/lib/creategem/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 165dcd90735d552212a261bbb75d2ba82f0fa819
|
4
|
+
data.tar.gz: cdb88b468ca75e5c0c3ce08a17d94d422a1b92d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b407619f8ed1179ab40055207e8812592f5725adef8e764f1c2bc9eac1ca777ef6499939c16705e6576492665648fa8a9d90c625fbf775283b5d29eac050004d
|
7
|
+
data.tar.gz: 71db9e8cf55f378150de2ba435ec5a7dc6d2ac7bb6dda25e0758e0d428c1a87b98f0d36ecddfe5d1d146c999fc900309a339005a46ce7ce85fb9b346cfce1cb1
|
data/README.md
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
Creategem creates a scaffold project for a new gem together with remote repository (Github or Bitbucket) and is ready to be released in a public or private gem server.
|
16
16
|
|
17
|
-
This project
|
17
|
+
This project was inspired by the [Bundler](http://bundler.io)'s `bundle gem GEM` command and by the great article [Deveoping a RubyGem using Bundler](https://github.com/radar/guides/blob/master/gem-development.md).
|
18
18
|
|
19
19
|
Similar to what Bundler's bundle gem command does, this gem generates a scaffold with all files you need to start, but it also has some additional features.
|
20
20
|
|
@@ -24,7 +24,8 @@ Features:
|
|
24
24
|
- automatically release patches, minor and major versions without having to manually increase versions (thanks to [gem-release](https://github.com/svenfuchs/gem-release))
|
25
25
|
- executable based on [Thor](http://whatisthor.com) (can be omited with --no-executable)
|
26
26
|
- test infrastructure based on minitest and minitest-reporters
|
27
|
-
- release to rubygems.org or to
|
27
|
+
- release to rubygems.org or to private geminabox gem server
|
28
|
+
- optionaly create rails plugin gem with (mountable) engine
|
28
29
|
- readme with badges for travis, codeclimate, coveralls, etc. for public projects (like the badges you see above)
|
29
30
|
|
30
31
|
|
@@ -39,18 +40,16 @@ Features:
|
|
39
40
|
|
40
41
|
When called without any options it is assumed that you want a gem with an executable and hosted in a public github git repository, and released to rubygems.org.
|
41
42
|
|
42
|
-
During the creation you will be asked for your github or bitbucket user name (only the first time, as the user name is saved in your git global config). You will also be asked to enter your github or bitbucket password when the remote repository is created for you
|
43
|
+
During the creation you will be asked for your github or bitbucket user name (only the first time, as the user name is saved in your git global config). You will also be asked to enter your github or bitbucket password when the remote repository is created for you.
|
43
44
|
|
44
|
-
When you use the `--private` option
|
45
|
-
|
46
|
-
When you specify the `--bitbucket` option, a bitbucket repository is created instead of github (default)
|
45
|
+
When you use the `--private` option a remote repository is made private and on release the gem is pushed to a private Geminabox server.
|
47
46
|
|
48
47
|
Per default a gem is created with an executable based on Thor, but you can omit the executable with the option `--no-executable`.
|
49
48
|
|
50
49
|
After you create the gem, edit your gemspec and change the summary and the description, commit the changes to git and invoke `rake release_patch` and your gem is being released.
|
51
50
|
|
52
51
|
|
53
|
-
$ creategem plugin GEM_NAME [--engine] [--mountable] [--private] [--
|
52
|
+
$ creategem plugin GEM_NAME [--engine] [--mountable] [--private] [--executable]
|
54
53
|
|
55
54
|
`creategem plugin` creates a rails plugin. You can also specify if the plugin should be an engine (`--engine`) or a mountable engine (`--mountable`).
|
56
55
|
|
data/lib/creategem/cli.rb
CHANGED
@@ -16,23 +16,21 @@ module Creategem
|
|
16
16
|
File.expand_path('../../../templates', __FILE__)
|
17
17
|
end
|
18
18
|
|
19
|
-
desc "gem NAME", "Creates a new gem with a given NAME with Github git repository; Options: --private (
|
20
|
-
option :private, type: :boolean, default: false, desc: "When true,
|
19
|
+
desc "gem NAME", "Creates a new gem with a given NAME with Github git repository; Options: --private (Geminabox), --no-executable, --bitbucket"
|
20
|
+
option :private, type: :boolean, default: false, desc: "When true, gem is published in a private geminabox repository, otherwise gem is published to Rubygems (default)"
|
21
21
|
option :executable, type: :boolean, default: true, desc: "When true, gem with executable is created"
|
22
|
-
option :
|
23
|
-
option :bitbucket, type: :boolean, default: false, desc: "When true, Bitbucket remote repository is created"
|
22
|
+
option :bitbucket, type: :boolean, default: false, desc: "When true, bitbucket repository is created, otherwise Github (default)"
|
24
23
|
def gem(gem_name)
|
25
24
|
create_gem_scaffold(gem_name)
|
26
25
|
initialize_repository(gem_name)
|
27
26
|
end
|
28
27
|
|
29
|
-
desc "plugin NAME", "Creates a new rails plugin with a given NAME with Github git repository; Options: --private (
|
30
|
-
option :private, type: :boolean, default: false, desc: "When true,
|
28
|
+
desc "plugin NAME", "Creates a new rails plugin with a given NAME with Github git repository; Options: --private (Geminabox), --executable, --engine, --mountable, --bitbucket"
|
29
|
+
option :private, type: :boolean, default: false, desc: "When true, gem is published in a private geminabox repository, otherwise gem is published to Rubygems (default)"
|
31
30
|
option :engine, type: :boolean, default: false, desc: "When true, gem with rails engine is created"
|
32
31
|
option :mountable, type: :boolean, default: false, desc: "When true, gem with mountable rails engine is created"
|
33
32
|
option :executable, type: :boolean, default: false, desc: "When true, gem with executable is created"
|
34
|
-
option :
|
35
|
-
option :bitbucket, type: :boolean, default: false, desc: "When true, Bitbucket remote repository is created"
|
33
|
+
option :bitbucket, type: :boolean, default: false, desc: "When true, bitbucket repository is created, otherwise Github (default)"
|
36
34
|
def plugin(gem_name)
|
37
35
|
@plugin = true
|
38
36
|
@engine = options[:engine] || options[:mountable]
|
@@ -51,12 +49,12 @@ module Creategem
|
|
51
49
|
@gem_name = gem_name
|
52
50
|
@class_name = Thor::Util.camel_case(gem_name.gsub("-", "_"))
|
53
51
|
@executable = options[:executable]
|
54
|
-
@vendor = options[:
|
52
|
+
@vendor = options[:private] ? :bitbucket : :github
|
55
53
|
@repository = Creategem::Repository.new(vendor: @vendor,
|
56
|
-
private: options[:private],
|
57
54
|
user: git_repository_user_name(@vendor),
|
58
55
|
name: gem_name,
|
59
|
-
gem_server_url: gem_server_url(
|
56
|
+
gem_server_url: gem_server_url(@vendor),
|
57
|
+
private: options[:private])
|
60
58
|
directory "gem_scaffold", gem_name
|
61
59
|
if @executable
|
62
60
|
directory "executable_scaffold", gem_name
|
data/lib/creategem/git.rb
CHANGED
@@ -15,7 +15,7 @@ module Creategem
|
|
15
15
|
say "Create remote #{repository.vendor} repository", :green
|
16
16
|
if repository.github?
|
17
17
|
token = ask("What is yout Github personal access token?")
|
18
|
-
run "curl
|
18
|
+
run "curl --request POST --user #{repository.user}:#{token} https://api.github.com/user/repos --data name=#{repository.name} --data private=#{repository.private?}"
|
19
19
|
else # bitbucket
|
20
20
|
run "curl --request POST --user #{repository.user} https://api.bitbucket.org/1.0/repositories/ --data name=#{repository.name} --data scm=git --data is_private=#{repository.private}"
|
21
21
|
end
|
data/lib/creategem/repository.rb
CHANGED
@@ -15,6 +15,7 @@ module Creategem
|
|
15
15
|
@user_name = ::Git.global_config "user.name"
|
16
16
|
@user_email = ::Git.global_config "user.email"
|
17
17
|
@gem_server_url = options[:gem_server_url]
|
18
|
+
@private = options[:private]
|
18
19
|
end
|
19
20
|
|
20
21
|
def github?
|
@@ -27,7 +28,7 @@ module Creategem
|
|
27
28
|
|
28
29
|
# this could change later. For now all private repositories are on bitbucket and all private ones on github
|
29
30
|
def private?
|
30
|
-
|
31
|
+
self.private
|
31
32
|
end
|
32
33
|
|
33
34
|
def public?
|
data/lib/creategem/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: creategem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Jancev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|