my_scripts 0.1.3 → 0.1.5

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
@@ -23,3 +23,11 @@
23
23
  == 0.1.3 / 2010-04-14
24
24
 
25
25
  * Gitto specs added
26
+
27
+ == 0.1.4 / 2010-04-14
28
+
29
+ * FIXME notes added to Bon and Jew
30
+
31
+ == 0.1.5 / 2010-04-17
32
+
33
+ * Debugging wake
data/Rakefile CHANGED
@@ -1,11 +1,11 @@
1
1
  require 'pathname'
2
2
  NAME = 'my_scripts'
3
- BASE_DIR = Pathname.new(__FILE__).dirname
4
- LIB_DIR = BASE_DIR + 'lib'
5
- PKG_DIR = BASE_DIR + 'pkg'
6
- DOC_DIR = BASE_DIR + 'rdoc'
3
+ BASE_PATH = Pathname.new(__FILE__).dirname
4
+ LIB_PATH = BASE_PATH + 'lib'
5
+ PKG_PATH = BASE_PATH + 'pkg'
6
+ DOC_PATH = BASE_PATH + 'rdoc'
7
7
 
8
- $LOAD_PATH.unshift LIB_DIR.to_s
8
+ $LOAD_PATH.unshift LIB_PATH.to_s
9
9
  require NAME
10
10
 
11
11
  CLASS_NAME = MyScripts
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.5
@@ -15,7 +15,11 @@ module MyScripts
15
15
 
16
16
  puts "Creating Bones project #{name} with summary: #{summary}"
17
17
 
18
- system %Q[bones create --github "#{summary}" -s #{DEFAULT_SKELETON} #{name}]
18
+ success = system %Q[bones create --github "#{summary}" -s #{DEFAULT_SKELETON} #{name}]
19
+
20
+ if success
21
+ system "cd #{name} && git grep FIXME"
22
+ end
19
23
  end
20
24
  end
21
25
  end
@@ -7,14 +7,19 @@ module MyScripts
7
7
  usage "project_name Summary or description goes here" if @argv.empty?
8
8
 
9
9
  # First Arg should be project name
10
- name = @argv.shift
10
+ name = @argv.shift
11
11
 
12
12
  # All the other args lumped into summary, or default summary
13
13
  summary = @argv.empty? ? "New project #{name}" : @argv.join(' ')
14
14
 
15
15
  puts "Creating Jeweler project #{name} with summary/description: #{summary}"
16
16
 
17
- system %Q[jeweler --rspec --cucumber --create-repo --summary "#{summary}" --description "#{summary}" #{name}]
17
+ success = system \
18
+ %Q[jeweler --rspec --cucumber --create-repo --summary "#{summary}" --description "#{summary}" #{name}]
19
+ if success
20
+ puts "Now you need to fix these files:"
21
+ system "cd #{name} && git grep FIXME"
22
+ end
18
23
  end
19
24
  end
20
25
  end
@@ -9,15 +9,22 @@ module MyScripts
9
9
 
10
10
  def initialize( name, argv, cli )
11
11
  require 'win/gui/input'
12
+ require 'win/error'
12
13
  self.class.send(:include, Win::Gui::Input)
13
14
  super
14
15
  end
15
16
 
16
17
  def move_mouse_randomly
17
18
  x, y = get_cursor_pos
18
- x1, y1 = x + rand(3) - 1, y + rand(3) - 1
19
- mouse_event(MOUSEEVENTF_ABSOLUTE, x1, y1, 0, 0)
20
- puts "Cursor positon set to #{x1}, #{y1}"
19
+
20
+ # For some reason, x or y returns as nil sometimes
21
+ if x && y
22
+ x1, y1 = x + rand(3) - 1, y + rand(3) - 1
23
+ mouse_event(MOUSEEVENTF_ABSOLUTE, x1, y1, 0, 0)
24
+ puts "Cursor positon set to #{x1}, #{y1}"
25
+ else
26
+ puts "X: #{x}, Y: #{y}, last error: #{Win::Error::get_last_error}"
27
+ end
21
28
  end
22
29
 
23
30
  def run
@@ -27,7 +34,7 @@ module MyScripts
27
34
  when 1
28
35
  sleep_time = @argv.first.to_f * 60
29
36
  else
30
- usage "[minutes] - prevents screen auto lock-up by moving mouse pointer every (4) [minutes]"
37
+ usage "[minutes] - prevents screen auto lock-up by moving mouse pointer every [(4) minutes]"
31
38
  end
32
39
 
33
40
  loop do
data/lib/my_scripts.rb CHANGED
@@ -1,6 +1,7 @@
1
+ require 'pathname'
2
+
1
3
  # Top level namespace
2
4
  module MyScripts
3
- require 'pathname'
4
5
 
5
6
  VERSION_FILE = Pathname.new(__FILE__).dirname + '../VERSION' # :nodoc:
6
7
  VERSION = VERSION_FILE.exist? ? VERSION_FILE.read.strip : nil
data/tasks/common.rake CHANGED
@@ -1,3 +1,13 @@
1
1
  #task :default => 'test:run'
2
2
  #task 'gem:release' => 'test:run'
3
3
 
4
+ #desc 'Bundle dependencies'
5
+ #task :bundle do
6
+ # output = `bundle check 2>&1`
7
+ #
8
+ # unless $?.to_i == 0
9
+ # puts output
10
+ # system "bundle install"
11
+ # puts
12
+ # end
13
+ #end
data/tasks/doc.rake CHANGED
@@ -4,7 +4,7 @@ task :doc => 'doc:rdoc'
4
4
  namespace :doc do
5
5
  require 'rake/rdoctask'
6
6
  Rake::RDocTask.new do |rdoc|
7
- rdoc.rdoc_dir = DOC_DIR.basename.to_s
7
+ rdoc.rdoc_dir = DOC_PATH.basename.to_s
8
8
  rdoc.title = "#{NAME} #{VERSION} Documentation"
9
9
  rdoc.rdoc_files.include('README*')
10
10
  rdoc.rdoc_files.include('lib/**/*.rb')
data/tasks/gem.rake CHANGED
@@ -13,12 +13,12 @@ namespace :gem do
13
13
  desc "(Re-)Build gem"
14
14
  task :build do
15
15
  puts "Remove existing gem package"
16
- rm_rf PKG_DIR
16
+ rm_rf PKG_PATH
17
17
  puts "Build new gem package"
18
18
  system "gem build #{NAME}.gemspec"
19
19
  puts "Move built gem to package dir"
20
- mkdir_p PKG_DIR
21
- mv gem_file, PKG_DIR
20
+ mkdir_p PKG_PATH
21
+ mv gem_file, PKG_PATH
22
22
  end
23
23
 
24
24
  desc "Cleanup already installed gem(s)"
@@ -29,11 +29,11 @@ namespace :gem do
29
29
 
30
30
  desc "Build and install gem"
31
31
  task :install => :build do
32
- system "gem install #{PKG_DIR}/#{gem_file}"
32
+ system "gem install #{PKG_PATH}/#{gem_file}"
33
33
  end
34
34
 
35
35
  desc "Build and push gem to Gemcutter"
36
36
  task :release => [:build, 'git:tag'] do
37
- system "gem push #{PKG_DIR}/#{gem_file}"
37
+ system "gem push #{PKG_PATH}/#{gem_file}"
38
38
  end
39
39
  end
data/tasks/git.rake CHANGED
@@ -23,11 +23,12 @@ namespace :git do
23
23
  end
24
24
 
25
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"
26
+ task :tag => :push do
27
+ tag = VERSION
28
+ puts "Creating git tag: #{tag}"
29
+ system %Q{git tag -a -m "Release tag #{tag}" #{tag}}
30
+ puts "Pushing #{tag} to remote"
31
+ system "git push origin #{tag}"
31
32
  end
32
33
 
33
34
  end
data/tasks/spec.rake CHANGED
@@ -6,7 +6,7 @@ namespace :spec do
6
6
 
7
7
  desc "Run all specs"
8
8
  Spec::Rake::SpecTask.new(:spec) do |t|
9
- t.spec_opts = ['--options', %Q{"#{BASE_DIR}/spec/spec.opts"}]
9
+ t.spec_opts = ['--options', %Q{"#{BASE_PATH}/spec/spec.opts"}]
10
10
  t.spec_files = FileList['spec/**/*_spec.rb']
11
11
  end
12
12
 
data/tasks/version.rake CHANGED
@@ -36,7 +36,7 @@ class Version
36
36
 
37
37
  def write(description = nil)
38
38
  CLASS_NAME::VERSION_FILE.open('w') {|file| file.puts to_s }
39
- (BASE_DIR + 'HISTORY').open('a') do |file|
39
+ (BASE_PATH + 'HISTORY').open('a') do |file|
40
40
  file.puts "\n== #{to_s} / #{Time.now.strftime '%Y-%m-%d'}\n"
41
41
  file.puts "\n* #{description}\n" if description
42
42
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 3
9
- version: 0.1.3
8
+ - 5
9
+ version: 0.1.5
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-14 00:00:00 +04:00
17
+ date: 2010-04-17 00:00:00 +04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -102,13 +102,12 @@ licenses: []
102
102
 
103
103
  post_install_message:
104
104
  rdoc_options:
105
- - --charset=UTF-8
105
+ - --charset
106
+ - UTF-8
106
107
  - --main
107
108
  - README.rdoc
108
- - -S
109
- - -N
110
109
  - --title
111
- - Example
110
+ - my_scripts
112
111
  require_paths:
113
112
  - lib
114
113
  required_ruby_version: !ruby/object:Gem::Requirement