fedux_org-stdlib 0.1.2 → 0.1.3
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.
- data/lib/fedux_org/stdlib/rake/documentation/yard.rb +12 -8
- data/lib/fedux_org/stdlib/rake/gems/bundler.rb +10 -6
- data/lib/fedux_org/stdlib/rake/gems/package.rb +6 -2
- data/lib/fedux_org/stdlib/rake/tests/travis.rb +1 -1
- data/lib/fedux_org/stdlib/rake/travis/lint.rb +8 -5
- data/lib/fedux_org/stdlib/rake/version/bump.rb +31 -28
- data/lib/fedux_org/stdlib/version.rb +1 -1
- metadata +1 -1
@@ -1,10 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
unless ENV.to_hash.has_key? 'CI'
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'yard'
|
5
|
+
rescue LoadError
|
6
|
+
$stderr.puts 'You need to install the "yard"-gem to make that rake task work.'
|
7
|
+
exit 1
|
8
|
+
end
|
9
|
+
|
10
|
+
YARD::Rake::YardocTask.new() do |y|
|
11
|
+
# y.options << '--verbose'
|
12
|
+
end
|
7
13
|
|
8
|
-
YARD::Rake::YardocTask.new() do |y|
|
9
|
-
# y.options << '--verbose'
|
10
14
|
end
|
@@ -1,8 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
unless ENV.to_hash.has_key? 'CI'
|
2
|
+
|
3
|
+
namespace :gem do
|
4
|
+
begin
|
5
|
+
require 'bundler/gem_tasks'
|
6
|
+
rescue LoadError
|
7
|
+
$stderr.puts 'You need to install the "bundler"-gem to make that rake task work.'
|
8
|
+
exit 1
|
9
|
+
end
|
7
10
|
end
|
11
|
+
|
8
12
|
end
|
@@ -1,7 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
unless ENV.to_hash.has_key? 'CI'
|
2
|
+
|
3
|
+
namespace :travis do
|
4
|
+
desc 'Runs travis-lint to check .travis.yml'
|
5
|
+
task :lint do
|
6
|
+
sh 'travis-lint'
|
7
|
+
end
|
5
8
|
end
|
6
|
-
end
|
7
9
|
|
10
|
+
end
|
@@ -1,31 +1,33 @@
|
|
1
|
-
|
1
|
+
unless ENV.to_hash.has_key? 'CI'
|
2
2
|
|
3
|
-
|
4
|
-
require 'active_support/core_ext/string/strip'
|
5
|
-
rescue LoadError
|
6
|
-
$stderr.puts 'You need to install the "activesupport"-gem to make that rake task work.'
|
7
|
-
exit 1
|
8
|
-
end
|
3
|
+
require_relative 'base'
|
9
4
|
|
10
|
-
begin
|
11
|
-
|
12
|
-
rescue LoadError
|
13
|
-
|
14
|
-
|
15
|
-
end
|
5
|
+
begin
|
6
|
+
require 'active_support/core_ext/string/strip'
|
7
|
+
rescue LoadError
|
8
|
+
$stderr.puts 'You need to install the "activesupport"-gem to make that rake task work.'
|
9
|
+
exit 1
|
10
|
+
end
|
16
11
|
|
17
|
-
|
18
|
-
|
19
|
-
|
12
|
+
begin
|
13
|
+
require 'erubis'
|
14
|
+
rescue LoadError
|
15
|
+
$stderr.puts 'You need to install the "erubis"-gem to make that rake task work.'
|
16
|
+
exit 1
|
17
|
+
end
|
20
18
|
|
21
|
-
|
19
|
+
namespace :version do
|
20
|
+
desc 'bump version of library to new version'
|
21
|
+
task :bump do
|
22
22
|
|
23
|
-
|
23
|
+
new_version = ENV['VERSION'] || ENV['version']
|
24
24
|
|
25
|
-
|
26
|
-
module_names = raw_module_names.collect { |n| n.chomp.match(/module\s+(\S+)/) {$1} }
|
25
|
+
raise Exception, "You need to define a version via \"VERSION=<version>\" or \"version=<version>\"." unless new_version
|
27
26
|
|
28
|
-
|
27
|
+
raw_module_names = File.open(version_file, "r").readlines.grep(/module/)
|
28
|
+
module_names = raw_module_names.collect { |n| n.chomp.match(/module\s+(\S+)/) {$1} }
|
29
|
+
|
30
|
+
template = <<-EOF
|
29
31
|
#main <%= @modules.first %>
|
30
32
|
<% @modules.each do |m| %>
|
31
33
|
module <%= m %>
|
@@ -34,15 +36,16 @@ namespace :version do
|
|
34
36
|
<% @modules.size.times do |m| %>
|
35
37
|
end
|
36
38
|
<% end %>
|
37
|
-
EOF
|
39
|
+
EOF
|
38
40
|
|
39
|
-
|
41
|
+
version_string = Erubis::Eruby.new(template).evaluate(modules: module_names, version: new_version)
|
40
42
|
|
41
|
-
|
42
|
-
|
43
|
-
|
43
|
+
File.open(version_file, "w") do |f|
|
44
|
+
f.write version_string.strip_heredoc
|
45
|
+
end
|
44
46
|
|
45
|
-
|
46
|
-
|
47
|
+
sh "git add #{version_file}"
|
48
|
+
sh "git commit -m 'version bump to #{new_version}'"
|
49
|
+
end
|
47
50
|
end
|
48
51
|
end
|