raketeer 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -1
- data/README.md +99 -0
- data/Rakefile +12 -0
- data/lib/raketeer/bump_task.rb +3 -7
- data/lib/raketeer/util.rb +14 -3
- data/lib/raketeer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d024ad7fff342f32aa3d07ed4eafdb0b42996e6812bc7b5c083bd7251aebef8
|
4
|
+
data.tar.gz: 1daff5b05304afc6ec8e3a8eeca34a3bb107e3fef435d65a8c057c6a4289a3e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f9e8d44767109f49cc8ef9edc0150200d00819c33845ff6876bd8b0fdb5622caaf298b6727fba1ca5672a59dc539cdafc5b87c15447f0a40fb9c4975aa32a74
|
7
|
+
data.tar.gz: 26a662ef27360ea9eb158254acb7687d765b6bc6f5933414d88b3dd5ddf8b68783850680cdea18cd4c8e75e2644b279a0076d94a759faa407dde260f6e0443f8
|
data/CHANGELOG.md
CHANGED
@@ -2,7 +2,18 @@
|
|
2
2
|
|
3
3
|
Format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
4
4
|
|
5
|
-
## [[Unreleased]](https://github.com/esotericpig/raketeer/compare/v0.2.
|
5
|
+
## [[Unreleased]](https://github.com/esotericpig/raketeer/compare/v0.2.7...master)
|
6
|
+
|
7
|
+
## [v0.2.7] - 2019-12-18
|
8
|
+
### Added
|
9
|
+
- Add more info to README
|
10
|
+
- Add default dirs to Util methods
|
11
|
+
- Add Util.get_env_bool() method
|
12
|
+
- Add more TODOs and skeletons for future
|
13
|
+
- Add strict as an env var to bump task
|
14
|
+
|
15
|
+
### Fixed
|
16
|
+
- Check env vars for bundle task in bump task
|
6
17
|
|
7
18
|
## [v0.2.6] - 2019-08-03
|
8
19
|
### Changed
|
data/README.md
CHANGED
@@ -8,6 +8,8 @@
|
|
8
8
|
|
9
9
|
Extra Ruby Rake Tasks.
|
10
10
|
|
11
|
+
A [CLI app](https://github.com/esotericpig/raketary) is also available that uses these tasks, which is useful for tasks like *bump* (which bumps the version for your RubyGem project) so that you don't have to include this Gem as a development dependency for every project.
|
12
|
+
|
11
13
|
## Contents
|
12
14
|
|
13
15
|
- [Setup](#setup)
|
@@ -49,6 +51,103 @@ $ bundle exec rake install:local
|
|
49
51
|
|
50
52
|
## [Using](#contents)
|
51
53
|
|
54
|
+
**TODO:** flesh out Using section
|
55
|
+
|
56
|
+
**Rakefile**
|
57
|
+
|
58
|
+
In your *Rakefile*, you can either include all tasks...
|
59
|
+
|
60
|
+
```Ruby
|
61
|
+
require 'raketeer/all'
|
62
|
+
```
|
63
|
+
|
64
|
+
Or, include the specific tasks that you need:
|
65
|
+
|
66
|
+
```Ruby
|
67
|
+
require 'raketeer/bump'
|
68
|
+
require 'raketeer/irb'
|
69
|
+
require 'raketeer/nokogiri_installs'
|
70
|
+
require 'raketeer/run'
|
71
|
+
```
|
72
|
+
|
73
|
+
If you have conflicting tasks and/or you want to see what tasks have been included, you can put them in a namespace:
|
74
|
+
|
75
|
+
```Ruby
|
76
|
+
namespace :rt do
|
77
|
+
require 'raketeer/all'
|
78
|
+
end
|
79
|
+
```
|
80
|
+
|
81
|
+
**Included Tasks**
|
82
|
+
|
83
|
+
```
|
84
|
+
rake bump[version] # Show/Set/Bump the version
|
85
|
+
rake bump:build[build] # Set/Erase the build metadata
|
86
|
+
rake bump:bundle # Bump the Gemfile.lock version
|
87
|
+
rake bump:help # Show the help/usage for bump tasks
|
88
|
+
rake bump:major[major] # Bump/Set the major version
|
89
|
+
rake bump:minor[minor] # Bump/Set the minor version
|
90
|
+
rake bump:patch[patch] # Bump/Set the patch version
|
91
|
+
rake bump:pre[pre] # Set/Erase the pre-release version
|
92
|
+
rake irb # Open an irb session loaded with this library
|
93
|
+
rake nokogiri_apt # Install Nokogiri libs for Ubuntu/Debian
|
94
|
+
rake nokogiri_dnf # Install Nokogiri libs for Fedora/CentOS/Red Hat
|
95
|
+
rake nokogiri_other # Install Nokogiri libs for other OSes
|
96
|
+
rake run # Run this project's main file: "rake run -- --version"
|
97
|
+
```
|
98
|
+
|
99
|
+
**bump:help**
|
100
|
+
|
101
|
+
```
|
102
|
+
$ rake bump:help
|
103
|
+
rake bump # Print the current version
|
104
|
+
|
105
|
+
# You can run a dry run for any task (will not write to files)
|
106
|
+
rake bump dryrun=true
|
107
|
+
|
108
|
+
rake bump[1.2.3-alpha.4-beta.5] # Set the version manually
|
109
|
+
rake bump major=1 minor=2 patch=3 # Set the version numbers
|
110
|
+
rake bump pre=alpha.4 build=beta.5 # Set the version extensions
|
111
|
+
rake bump major=+1 minor=+1 patch=+1 # Bump the version numbers by 1
|
112
|
+
rake bump major=+2 minor=+3 patch=+4 # Bump the version numbers by X
|
113
|
+
|
114
|
+
rake bump:major # Bump the major version by 1
|
115
|
+
rake bump:major[1] # Set the major version to 1
|
116
|
+
rake bump:major[+2] # Bump the major version by 2
|
117
|
+
rake bump:minor # Bump the minor version by 1
|
118
|
+
rake bump:minor[2] # Set the minor version to 2
|
119
|
+
rake bump:minor[+3] # Bump the minor version by 3
|
120
|
+
rake bump:patch # Bump the patch version by 1
|
121
|
+
rake bump:patch[3] # Set the patch version to 3
|
122
|
+
rake bump:patch[+4] # Bump the patch version by 4
|
123
|
+
rake bump:pre # Erase the pre-release version
|
124
|
+
rake bump:pre[alpha.4] # Set the pre-release version
|
125
|
+
rake bump:build # Erase the build metadata
|
126
|
+
rake bump:build[beta.5] # Set the build metadata
|
127
|
+
rake bump:bundle # Bump the Gemfile.lock version
|
128
|
+
```
|
129
|
+
|
130
|
+
**Modifying Tasks**
|
131
|
+
|
132
|
+
If you need more control, for now, please look at the accessors of each task (better documentation is planned for v1.0.0):
|
133
|
+
|
134
|
+
- [BumpTask](lib/raketeer/bump_task.rb)
|
135
|
+
- [IRBTask](lib/raketeer/irb_task.rb)
|
136
|
+
- [NokogiriAPTTask](lib/raketeer/nokogiri_install_tasks.rb)
|
137
|
+
- [NokogiriDNFTask](lib/raketeer/nokogiri_install_tasks.rb)
|
138
|
+
- [NokogiriOtherTask](lib/raketeer/nokogiri_install_tasks.rb)
|
139
|
+
- [RunTask](lib/raketeer/run_task.rb)
|
140
|
+
|
141
|
+
For example, in your *Rakefile*:
|
142
|
+
|
143
|
+
```Ruby
|
144
|
+
require 'raketeer/bump_task'
|
145
|
+
|
146
|
+
Raketeer::BumpTask.new() do |task|
|
147
|
+
task.strict = true
|
148
|
+
end
|
149
|
+
```
|
150
|
+
|
52
151
|
## [Hacking](#contents)
|
53
152
|
|
54
153
|
```
|
data/Rakefile
CHANGED
@@ -34,3 +34,15 @@ CLOBBER.include('doc/')
|
|
34
34
|
namespace :rt do
|
35
35
|
require 'raketeer/all'
|
36
36
|
end
|
37
|
+
|
38
|
+
namespace :todo do
|
39
|
+
# TODO: make this into a task class
|
40
|
+
# TODO: do 'gem:files'? and also 'gem:info' for all other methods?
|
41
|
+
desc 'Output dat gemspec bootyliciousness'
|
42
|
+
task :gem do |task,args|
|
43
|
+
# TODO: if this doesn't work, read *.gemspec somehow? probably not...
|
44
|
+
gem = Gem::Specification.find_by_name('raketeer')
|
45
|
+
puts gem.files
|
46
|
+
#puts gem.methods.sort - Object.methods
|
47
|
+
end
|
48
|
+
end
|
data/lib/raketeer/bump_task.rb
CHANGED
@@ -23,9 +23,7 @@
|
|
23
23
|
|
24
24
|
require 'date'
|
25
25
|
require 'rake'
|
26
|
-
|
27
26
|
require 'rake/tasklib'
|
28
|
-
|
29
27
|
require 'raketeer/bump_ver'
|
30
28
|
require 'raketeer/files_bumper'
|
31
29
|
require 'raketeer/sem_ver'
|
@@ -128,6 +126,7 @@ module Raketeer
|
|
128
126
|
|
129
127
|
desc 'Bump the Gemfile.lock version'
|
130
128
|
task :bundle do
|
129
|
+
check_env()
|
131
130
|
bump_bundle_file()
|
132
131
|
end
|
133
132
|
|
@@ -318,11 +317,8 @@ module Raketeer
|
|
318
317
|
end
|
319
318
|
|
320
319
|
def check_env()
|
321
|
-
|
322
|
-
|
323
|
-
if !env_dryrun.nil?() && !(env_dryrun = env_dryrun.to_s().strip()).empty?()
|
324
|
-
@dry_run = Util.to_bool(env_dryrun)
|
325
|
-
end
|
320
|
+
@dry_run = Util.get_env_bool('dryrun',@dry_run)
|
321
|
+
@strict = Util.get_env_bool('strict',@strict)
|
326
322
|
end
|
327
323
|
|
328
324
|
def print_help()
|
data/lib/raketeer/util.rb
CHANGED
@@ -30,7 +30,7 @@ module Raketeer
|
|
30
30
|
# @since 0.2.4
|
31
31
|
TRUE_BOOLS = ['1','on','t','true','y','yes'].freeze()
|
32
32
|
|
33
|
-
def self.find_main_executable(bin_dir)
|
33
|
+
def self.find_main_executable(bin_dir='bin')
|
34
34
|
# Try the bin/ dir
|
35
35
|
main_exe = Dir.glob(File.join(bin_dir,'*'))
|
36
36
|
|
@@ -48,9 +48,9 @@ module Raketeer
|
|
48
48
|
return nil
|
49
49
|
end
|
50
50
|
|
51
|
-
def self.find_main_module()
|
51
|
+
def self.find_main_module(lib_dir='lib')
|
52
52
|
# Try the lib/ dir
|
53
|
-
main_file = Dir.glob(File.join(
|
53
|
+
main_file = Dir.glob(File.join(lib_dir,'*.rb'))
|
54
54
|
|
55
55
|
return File.basename(main_file[0],'.*') if main_file.length == 1
|
56
56
|
|
@@ -62,6 +62,17 @@ module Raketeer
|
|
62
62
|
return nil
|
63
63
|
end
|
64
64
|
|
65
|
+
# @since 0.2.7
|
66
|
+
def self.get_env_bool(env_name,def_value=nil)
|
67
|
+
value = ENV[env_name]
|
68
|
+
|
69
|
+
if value.nil?() || (value = value.to_s().strip()).empty?()
|
70
|
+
return def_value
|
71
|
+
end
|
72
|
+
|
73
|
+
return to_bool(value)
|
74
|
+
end
|
75
|
+
|
65
76
|
# @since 0.2.4
|
66
77
|
def self.to_bool(obj)
|
67
78
|
return TRUE_BOOLS.include?(obj.to_s().downcase())
|
data/lib/raketeer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: raketeer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Bradley Whited (@esotericpig)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|