my_scripts 0.0.23 → 0.0.24

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 CHANGED
@@ -6,3 +6,5 @@
6
6
  == 0.0.22 / 2010-04-12
7
7
 
8
8
  == 0.0.23 / 2010-04-13
9
+
10
+ == 0.0.24 / 2010-04-13
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.23
1
+ 0.0.24
@@ -5,29 +5,20 @@ module MyScripts
5
5
  #
6
6
  class Gitto < Script
7
7
  def run
8
- usage "[bump: 1 - patch, 10 - minor, 100 - major] Commit message goes here" if @argv.empty?
8
+ usage "[0.1.2 - version, 100/10/1 - bump major/minor/patch, .patch - add patch] Commit message goes here" if @argv.empty?
9
9
 
10
- # If first Arg is a number, it indicates version bump
11
- bump = @argv[0].to_i > 0 ? @argv.shift.to_i : 0
10
+ # First Arg may indicate version command if it matches pattern
11
+ ver = @argv[0] =~ /^(\d+\.\d+\.\d+(?:\.(.*?))?|\.(.*?)|\d{1}0{0,2})$/ ? @argv[0].shift : nil
12
12
 
13
13
  # All the other args lumped into message, or default message
14
- message = @argv.empty? ? 'Commit' : @argv.join(' ')
15
- # Timestamp added to message
16
- message += " #{Time.now.to_s[0..-6]}"
14
+ message = @argv.empty? ? "Commit #{Time.now.to_s[0..-6]}" : @argv.join(' ')
17
15
 
18
- puts "Committing (versionup =#{bump}) with message: #{message}"
16
+ puts "Committing #{ ver ? "(version = #{ver}) " : ""}with message: #{message}"
19
17
 
20
- case bump
21
- when 1..9
22
- system %Q[rake version:bump:patch]
23
- when 10..99
24
- system %Q[rake version:bump:minor]
25
- when 100
26
- system %Q[rake version:bump:major]
27
- end
28
- system %Q[git add --all]
29
- system %Q[git commit -a -m "#{message}" --author arvicco]
30
- system %Q[git push]
18
+ system %Q{rake version[#{ver}]} if ver
19
+ system %Q{git add --all}
20
+ system %Q{git commit -a -m "#{message}" --author arvicco}
21
+ system %Q{git push}
31
22
  end
32
23
  end
33
24
  end
@@ -8,9 +8,7 @@ module MyScripts
8
8
  SLEEP_TIME = 4 * 60 # seconds
9
9
 
10
10
  def initialize( name, argv, cli )
11
-
12
11
  require 'win/gui/input'
13
-
14
12
  self.class.send(:include, Win::Gui::Input)
15
13
  super
16
14
  end
@@ -27,7 +25,7 @@ module MyScripts
27
25
  when 0
28
26
  sleep_time = SLEEP_TIME
29
27
  when 1
30
- p sleep_time = @argv.first.to_f * 60
28
+ sleep_time = @argv.first.to_f * 60
31
29
  else
32
30
  usage "[minutes] - prevents screen auto lock-up by moving mouse pointer every (4) [minutes]"
33
31
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 23
9
- version: 0.0.23
8
+ - 24
9
+ version: 0.0.24
10
10
  platform: ruby
11
11
  authors:
12
12
  - arvicco
@@ -50,8 +50,6 @@ executables:
50
50
  - dummy
51
51
  - gitto
52
52
  - jew
53
- - mybones
54
- - newscript
55
53
  - rabbit
56
54
  - wake
57
55
  extensions: []
@@ -65,8 +63,6 @@ files:
65
63
  - bin/dummy
66
64
  - bin/gitto
67
65
  - bin/jew
68
- - bin/mybones
69
- - bin/newscript
70
66
  - bin/rabbit
71
67
  - bin/wake
72
68
  - lib/my_scripts/citi.rb
@@ -75,7 +71,6 @@ files:
75
71
  - lib/my_scripts/extensions.rb
76
72
  - lib/my_scripts/gitto.rb
77
73
  - lib/my_scripts/jew.rb
78
- - lib/my_scripts/mybones.rb
79
74
  - lib/my_scripts/rabbit.rb
80
75
  - lib/my_scripts/script.rb
81
76
  - lib/my_scripts/wake.rb
data/bin/mybones DELETED
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require File.dirname(__FILE__) + '/../lib/my_scripts'
4
-
5
- MyScripts::CLI.run :mybones, ARGV
data/bin/newscript DELETED
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require File.dirname(__FILE__) + '/../lib/my_scripts'
4
-
5
- MyScripts::CLI.run :newscript, ARGV
@@ -1,20 +0,0 @@
1
- module MyScripts
2
- # This script uses Mr.Bones gem to create new project skeleton, local git repo and
3
- # initiate remote repo on github
4
- #
5
- class Mybones < Script
6
- def run
7
- usage "project_name Summary or description goes here" if @argv.empty?
8
-
9
- # First Arg should be project name
10
- project = @argv.shift
11
-
12
- # All the other args lumped into summary, or default summary
13
- summary = @argv.empty? ? "New project #{project}" : @argv.join(' ')
14
-
15
- puts "Creating Bones project #{project} with summary: #{summary}"
16
-
17
- system %Q[bones create --github "#{summary}" -s basic #{project}]
18
- end
19
- end
20
- end