my_scripts 0.0.22 → 0.0.23

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/HISTORY ADDED
@@ -0,0 +1,8 @@
1
+ == 1.0.0 / 2010-04-08
2
+
3
+ * 1 major enhancement
4
+ * Birthday!
5
+
6
+ == 0.0.22 / 2010-04-12
7
+
8
+ == 0.0.23 / 2010-04-13
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.22
1
+ 0.0.23
data/tasks/common.rake ADDED
@@ -0,0 +1,3 @@
1
+ #task :default => 'test:run'
2
+ #task 'gem:release' => 'test:run'
3
+
data/tasks/doc.rake ADDED
@@ -0,0 +1,12 @@
1
+ desc 'Alias to doc:rdoc'
2
+ task :doc => 'doc:rdoc'
3
+
4
+ namespace :doc do
5
+ require 'rake/rdoctask'
6
+ Rake::RDocTask.new do |rdoc|
7
+ rdoc.rdoc_dir = DOC_DIR.basename.to_s
8
+ rdoc.title = "#{NAME} #{VERSION} Documentation"
9
+ rdoc.rdoc_files.include('README*')
10
+ rdoc.rdoc_files.include('lib/**/*.rb')
11
+ end
12
+ end
data/tasks/gem.rake ADDED
@@ -0,0 +1,36 @@
1
+ desc "Alias to gem:release"
2
+ task :release => 'gem:release'
3
+
4
+ desc "Alias to gem:build"
5
+ task :gem => 'gem:build'
6
+
7
+ namespace :gem do
8
+ gem_file = "#{NAME}-#{VERSION}.gem"
9
+
10
+ desc "(Re-)Build gem"
11
+ task :build do
12
+ puts "Remove existing gem package"
13
+ rm_rf PKG_DIR
14
+ puts "Build new gem package"
15
+ system "gem build #{NAME}.gemspec"
16
+ puts "Move built gem to package dir"
17
+ mkdir_p PKG_DIR
18
+ mv gem_file, PKG_DIR
19
+ end
20
+
21
+ desc "Cleanup already installed gem(s)"
22
+ task :cleanup do
23
+ puts "Cleaning up installed gem(s)"
24
+ system "gem cleanup #{NAME}"
25
+ end
26
+
27
+ desc "Build and install gem"
28
+ task :install => :build do
29
+ system "gem install #{PKG_DIR}/#{gem_file}"
30
+ end
31
+
32
+ desc "Build and push gem to Gemcutter"
33
+ task :release => [:build, 'git:tag'] do
34
+ system "gem push #{PKG_DIR}/#{gem_file}"
35
+ end
36
+ end
data/tasks/git.rake ADDED
@@ -0,0 +1,33 @@
1
+ desc "Alias to git:commit"
2
+ task :git => 'git:commit'
3
+
4
+ namespace :git do
5
+
6
+ desc "Stage and commit your work [with message]"
7
+ task :commit, [:message] do |t, args|
8
+ puts "Staging new (unversioned) files"
9
+ system "git add --all"
10
+ if args.message
11
+ puts "Committing with message: #{args.message}"
12
+ system %Q[git commit -a -m "#{args.message}" --author arvicco]
13
+ else
14
+ puts "Committing"
15
+ system %Q[git commit -a -m "No message" --author arvicco]
16
+ end
17
+ end
18
+
19
+ desc "Push local changes to Github"
20
+ task :push => :commit do
21
+ puts "Pushing local changes to remote"
22
+ system "git push"
23
+ end
24
+
25
+ desc "Create (release) tag on Github"
26
+ task :tag => :commit do
27
+ puts "Creating git tag: #{VERSION}"
28
+ system %Q{git tag -a -m "Release tag #{VERSION}" #{VERSION}}
29
+ puts "Pushing local changes to remote"
30
+ system "git push"
31
+ end
32
+
33
+ end
data/tasks/spec.rake ADDED
@@ -0,0 +1,19 @@
1
+ desc 'Alias to spec:spec'
2
+ task :spec => 'spec:spec'
3
+
4
+ namespace :spec do
5
+ require 'spec/rake/spectask'
6
+
7
+ desc "Run all specs"
8
+ Spec::Rake::SpecTask.new(:spec) do |t|
9
+ t.spec_opts = ['--options', %Q{"#{BASE_DIR}/spec/spec.opts"}]
10
+ t.spec_files = FileList['spec/**/*_spec.rb']
11
+ end
12
+
13
+ desc "Run specs with RCov"
14
+ Spec::Rake::SpecTask.new(:rcov) do |t|
15
+ t.spec_files = FileList['spec/**/*_spec.rb']
16
+ t.rcov = true
17
+ t.rcov_opts = ['--exclude', 'spec']
18
+ end
19
+ end
@@ -0,0 +1,71 @@
1
+ class Version
2
+ attr_accessor :major, :minor, :patch, :build
3
+
4
+ def initialize(version_string)
5
+ raise "Invalid version #{version_string}" unless version_string =~ /^(\d+)\.(\d+)\.(\d+)(?:\.(.*?))?$/
6
+ @major = $1.to_i
7
+ @minor = $2.to_i
8
+ @patch = $3.to_i
9
+ @build = $4
10
+ end
11
+
12
+ def bump_major(x)
13
+ @major += x.to_i
14
+ @minor = 0
15
+ @patch = 0
16
+ @build = nil
17
+ end
18
+
19
+ def bump_minor(x)
20
+ @minor += x.to_i
21
+ @patch = 0
22
+ @build = nil
23
+ end
24
+
25
+ def bump_patch(x)
26
+ @patch += x.to_i
27
+ @build = nil
28
+ end
29
+
30
+ def update(major, minor, patch, build=nil)
31
+ @major = major
32
+ @minor = minor
33
+ @patch = patch
34
+ @build = build
35
+ end
36
+
37
+ def write(description = nil)
38
+ CLASS_NAME::VERSION_FILE.open('w') {|file| file.puts to_s }
39
+ (BASE_DIR + 'HISTORY').open('a') do |file|
40
+ file.puts "\n== #{to_s} / #{Time.now.strftime '%Y-%m-%d'}\n"
41
+ file.puts "\n* #{description}\n" if description
42
+ end
43
+ end
44
+
45
+ def to_s
46
+ [major, minor, patch, build].compact.join('.')
47
+ end
48
+ end
49
+
50
+ desc 'Set version: [x.y.z] - explicitly, [1/10/100] - bump major/minor/patch, [.build] - build'
51
+ task :version, [:command, :description] do |t, args|
52
+ version = Version.new(VERSION)
53
+ case args.command
54
+ when /^(\d+)\.(\d+)\.(\d+)(?:\.(.*?))?$/ # Set version explicitly
55
+ version.update($1, $2, $3, $4)
56
+ when /^\.(.*?)$/ # Set build
57
+ version.build = $1
58
+ when /^(\d{1})$/ # Bump patch
59
+ version.bump_patch $1
60
+ when /^(\d{1})0$/ # Bump minor
61
+ version.bump_minor $1
62
+ when /^(\d{1})00$/ # Bump major
63
+ version.bump_major $1
64
+ else # Unknown command, just display VERSION
65
+ puts "#{NAME} #{version}"
66
+ next
67
+ end
68
+
69
+ puts "Writing version #{version} to VERSION file"
70
+ version.write args.description
71
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 22
9
- version: 0.0.22
8
+ - 23
9
+ version: 0.0.23
10
10
  platform: ruby
11
11
  authors:
12
12
  - arvicco
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-12 00:00:00 +04:00
17
+ date: 2010-04-13 00:00:00 +04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -58,6 +58,7 @@ extensions: []
58
58
 
59
59
  extra_rdoc_files:
60
60
  - LICENSE
61
+ - HISTORY
61
62
  - README.rdoc
62
63
  files:
63
64
  - bin/citi
@@ -86,11 +87,18 @@ files:
86
87
  - features/my_scripts.feature
87
88
  - features/step_definitions/my_scripts_steps.rb
88
89
  - features/support/env.rb
90
+ - tasks/common.rake
91
+ - tasks/doc.rake
92
+ - tasks/gem.rake
93
+ - tasks/git.rake
94
+ - tasks/spec.rake
95
+ - tasks/version.rake
89
96
  - Rakefile
97
+ - README.rdoc
90
98
  - LICENSE
91
99
  - VERSION
100
+ - HISTORY
92
101
  - .gitignore
93
- - README.rdoc
94
102
  has_rdoc: true
95
103
  homepage: http://github.com/arvicco/my_scripts
96
104
  licenses: []
@@ -98,6 +106,12 @@ licenses: []
98
106
  post_install_message:
99
107
  rdoc_options:
100
108
  - --charset=UTF-8
109
+ - --main
110
+ - README.rdoc
111
+ - -S
112
+ - -N
113
+ - --title
114
+ - Example
101
115
  require_paths:
102
116
  - lib
103
117
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -116,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
130
  version: "0"
117
131
  requirements: []
118
132
 
119
- rubyforge_project:
133
+ rubyforge_project: ""
120
134
  rubygems_version: 1.3.6
121
135
  signing_key:
122
136
  specification_version: 3