run-gem-dev 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c16a6d97c9bc6eb1c95d00fea39c81a513571937
4
- data.tar.gz: 0da0c12c5c821d49e98f1b7280c780473a17813e
3
+ metadata.gz: 8384400d2fed3a7e13b975cc131cd24725566d7b
4
+ data.tar.gz: b511593f4c8a460b038876d547ae12da884c463c
5
5
  SHA512:
6
- metadata.gz: be1272fe790e9cc7334eda22db9a3b3f12792fee06e0584dcb67613cd4f3d49d66758c251c4ecea52d97180a45ee17360be2673e8016b535667205e94913ce4f
7
- data.tar.gz: 92f136964cd12e9170e562a58b0e625a3f3acd3323471623b0f962312d4ed1515440bf7a1ad044a5525f8dce125a9ee0268c7b6747a66a5e720762d69cc52f5a
6
+ metadata.gz: 4e60c0c146e5671db7e492055c337171b1f6c1f7a06ccbcb622dab6e4c59b43bfedd4d9f52380e6cf0f1e1d19b6ddc9ea8a1d2cd6bdce6697a098da9d6785e1e
7
+ data.tar.gz: 192a6ed53997c7cfb9a11a1e44f4238ef46a35668c985bb9f554ed60e14780236907cca4aa876e259cd4def5800da4256ec0a78a1bc42c8ef747c12af2cb9799
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  Run Gem Dev
2
2
  ===========
3
3
 
4
+ [![Gem Version](https://badge.fury.io/rb/run-gem-dev.svg)](http://badge.fury.io/rb/run-gem-dev)
5
+
4
6
  [Runfile](https://github.com/DannyBen/runfile) tasks for gem developers.
5
7
 
6
8
  ## Install
@@ -12,12 +14,28 @@ Run Gem Dev
12
14
  Put this in your Runfile
13
15
 
14
16
  ```ruby
15
- RunGemDev::Tasks.embed 'your-gem-name'
17
+ require "run-gem-dev"
18
+
19
+ name "My Gem Runfile"
20
+ summary "Tasks for my gem"
21
+ version "0.1.0"
22
+
23
+ RunGemDev::Tasks.embed 'run-gem-dev'
24
+
25
+ # Your other tasks here
26
+
16
27
  ```
17
28
 
29
+ ## Available Tasks
30
+
31
+ run gem build [<folder>]
32
+ run gem install
33
+ run gem publish
34
+ run gem yank [<version>]
35
+ run gem test [<name>]
36
+
18
37
 
19
38
  ## Todo
20
39
 
21
40
  - Docs
22
- - Tests
23
- - Yank `gem yank gemname -v 0.1.0`
41
+ - Add `init` (scaffold gemspec and folders)
@@ -1,53 +1,61 @@
1
1
 
2
2
  module RunGemDev
3
- class Tasks
4
- def self.embed(gemname, gemdir="gems")
5
- command "gem"
6
-
7
- spec = Gem::Specification::load "#{gemname}.gemspec"
8
- spec or abort "Error loading #{gemname}.gemspec"
9
- gemver = spec.version.to_s
10
-
11
- usage "build [<folder>]"
12
- help "Build gem from gemspec and move it to <folder>"
13
- action :build do |args|
14
- folder = args['<folder>'] || gemdir
15
- say "Building gem..."
16
- cmd = "gem build #{gemname}.gemspec"
17
- say "Running #{cmd}"
18
- system cmd
19
- files = Dir["*.gem"]
20
- say "Moving to gems folder"
21
- files.each {|f| FileUtils.mv f, gemdir }
22
- end
23
-
24
- help "Install local gem"
25
- action :install do
26
- gemfile = "gems/#{gemname}-#{gemver}.gem"
27
- cmd = "gem install #{gemfile}"
28
- say "Running: #{cmd}"
29
- system cmd
30
- end
31
-
32
- help "Publish gem"
33
- action :publish do
34
- gemfile = "gems/#{gemname}-#{gemver}.gem"
35
- File.exist? gemfile or abort "File not found #{gemfile}"
36
- cmd = "gem push #{gemfile}"
37
- say "Running: #{cmd}"
38
- system cmd
39
- end
40
-
41
- usage "test [<name>]"
42
- help "Run all tests or a single test file"
43
- action :test do |args|
44
- name = args['<name>'] || "*"
45
- cmd = "ruby -Itest test/test_#{name}.rb"
46
- say "Running #{cmd}"
47
- system cmd
48
- end
49
-
50
- endcommand
3
+ def self.tasks(gemname, gemdir="gems")
4
+ command "gem"
5
+
6
+ spec = Gem::Specification::load "#{gemname}.gemspec"
7
+ spec or abort "Error loading #{gemname}.gemspec"
8
+ gemver = spec.version.to_s
9
+
10
+ usage "build [--install]"
11
+ help "Build gem from gemspec and move it to '#{gemdir}' folder.\nUse --install to also install it."
12
+ action :build do |args|
13
+ say "Building gem..."
14
+ cmd = "gem build #{gemname}.gemspec"
15
+ say "Running: #{cmd}"
16
+ system cmd
17
+ say "Moving to #{gemdir}..."
18
+ files = Dir["*.gem"]
19
+ files.each {|f| FileUtils.mv f, gemdir }
20
+ args['--install'] and call "gem install"
21
+ end
22
+
23
+ help "Install local gem"
24
+ action :install do
25
+ gemfile = "gems/#{gemname}-#{gemver}.gem"
26
+ cmd = "gem install #{gemfile}"
27
+ say "Running: #{cmd}"
28
+ system cmd
29
+ end
30
+
31
+ help "Publish gem to rubygems"
32
+ action :publish do
33
+ gemfile = "gems/#{gemname}-#{gemver}.gem"
34
+ File.exist? gemfile or abort "File not found #{gemfile}"
35
+ cmd = "gem push #{gemfile}"
36
+ say "Running: #{cmd}"
37
+ system cmd
51
38
  end
39
+
40
+ usage "yank [<version>]"
41
+ help "Yank gem from rubygems"
42
+ action :yank do |args|
43
+ ver = args['<version>'] || gemver
44
+ cmd = "gem yank #{gemname} -v #{ver}"
45
+ say "Running: #{cmd}"
46
+ system cmd
47
+ end
48
+
49
+ usage "test [<name>]"
50
+ help "Run all tests or a single test file"
51
+ action :test do |args|
52
+ name = args['<name>'] || "*"
53
+ cmd = "ruby -Itest test/test_#{name}.rb"
54
+ say "Running: #{cmd}"
55
+ system cmd
56
+ end
57
+
58
+ endcommand
52
59
  end
60
+
53
61
  end
@@ -1,3 +1,3 @@
1
1
  module RunGemDev
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: run-gem-dev
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-26 00:00:00.000000000 Z
11
+ date: 2015-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: runfile
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '5.6'
41
+ - !ruby/object:Gem::Dependency
42
+ name: colsole
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'
41
55
  description: A collection of gem related tasks for Runfile
42
56
  email: db@dannyben.com
43
57
  executables: []