dev_commands 0.0.31 → 0.0.32

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.
Files changed (5) hide show
  1. data/README.md +24 -0
  2. data/lib/gemspec.rb +1 -1
  3. data/lib/publish.rb +1 -1
  4. data/lib/test.rb +2 -2
  5. metadata +2 -2
data/README.md CHANGED
@@ -56,6 +56,30 @@ CLEAN.clear
56
56
  CLOBBER.clear
57
57
  ```
58
58
 
59
+ COMMANDS is an automatically populated command hash defined by dev_command. If the
60
+ auto-generated commands are acceptable, the following code may be used.
61
+
62
+ ```
63
+ require 'dev_commands'
64
+
65
+ task :default do
66
+ COMMANDS.execute
67
+ end
68
+ ```
69
+
70
+ Any default commands may be completely overriden by overwriting the appropriate key,
71
+ for instance, to override all default build commands, the following could be done.
72
+
73
+ ```
74
+ require 'dev_commands'
75
+
76
+ COMMANDS[:build]=['gem build my-gem.gemspec']
77
+
78
+ task :default do
79
+ COMMANDS.execute
80
+ end
81
+ ```
82
+
59
83
  ### License
60
84
  Copyright 2014-2015 Lou Parslow
61
85
 
@@ -19,7 +19,7 @@ class Gemspec
19
19
  published_version=''
20
20
  spec=Gem::Specification.load(gemspec_file)
21
21
  begin
22
- published_version = `gem list -r #{spec.name} -r`.scan(/\((\d+.\d+.\d+)\)/)[0][0]
22
+ published_version = `gem list -r #{spec.name}`.scan(/\((\d+.\d+.\d+)\)/)[0][0]
23
23
  rescue
24
24
  published_version=''
25
25
  end
@@ -1,7 +1,7 @@
1
1
  require_relative('internet.rb')
2
2
  class Publish < Array
3
3
  def update
4
- if(Internet.available?)
4
+ if(Internet.available? && `git branch`.include?('* master'))
5
5
  Dir.glob('*.gemspec').each{|gemspec_file|
6
6
  add "gem push #{Gemspec.gemfile(gemspec_file)}" if !Gemspec.published? gemspec_file
7
7
  }
@@ -29,7 +29,7 @@ class Test < Array
29
29
  @@nunit_console=''
30
30
  def self.nunit_console
31
31
  if(!File.exists?(@@nunit_console))
32
- @@nunit_console = NUNIT_CONSOLE if(defined(NUNIT_CONSOLE))
32
+ @@nunit_console = NUNIT_CONSOLE if(defined?(NUNIT_CONSOLE))
33
33
  @@nunit_console = "C:\\Program Files (x86)\\NUnit 2.6.4\\bin\\nunit-console.exe" if(!File.exists?(@@nunit_console))
34
34
  @@nunit_console = "C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\nunit-console.exe" if(!File.exists?(@@nunit_console))
35
35
  end
@@ -42,7 +42,7 @@ class Test < Array
42
42
  @@nunit_console_x86=''
43
43
  def self.nunit_console_x86
44
44
  if(!File.exists?(@@nunit_console_x86))
45
- @@nunit_console_x86 = NUNIT_CONSOLE_X86 if(defined(NUNIT_CONSOLE_X86))
45
+ @@nunit_console_x86 = NUNIT_CONSOLE_X86 if(defined?(NUNIT_CONSOLE_X86))
46
46
  @@nunit_console_x86 = "C:\\Program Files (x86)\\NUnit 2.6.4\\bin\\nunit-console-x86.exe" if(!File.exists?(@@nunit_console_x86))
47
47
  @@nunit_console_x86 = "C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\nunit-console-x86.exe" if(!File.exists?(@@nunit_console_x86))
48
48
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dev_commands
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.31
4
+ version: 0.0.32
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-14 00:00:00.000000000 Z
12
+ date: 2015-01-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake