p4tools 0.1.4 → 0.1.4.1

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/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ .idea
2
+ *.gem
3
+ lib/config
data/Gemfile CHANGED
@@ -1,5 +1,6 @@
1
1
  # A sample Gemfile
2
- source "https://rubygems.org"
2
+ source 'https://rubygems.org'
3
+ source 'https://rubygems.herokuapp.com/'
3
4
 
4
- gem 'rautomation', '0.14.1'
5
- gem 'P4Ruby-mingwx86', '~> 2014.1'
5
+ gem 'P4Ruby-mingwx86', '~> 2014.1'
6
+ gem 'rake'
data/Gemfile.lock CHANGED
@@ -1,14 +1,13 @@
1
- GEM
2
- remote: https://rubygems.org/
3
- specs:
4
- P4Ruby-mingwx86 (2014.1)
5
- ffi (1.9.0-x86-mingw32)
6
- rautomation (0.14.1)
7
- ffi (= 1.9.0)
8
-
9
- PLATFORMS
10
- x86-mingw32
11
-
12
- DEPENDENCIES
13
- P4Ruby-mingwx86 (~> 2014.1)
14
- rautomation (= 0.14.1)
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ remote: https://rubygems.herokuapp.com/
4
+ specs:
5
+ P4Ruby-mingwx86 (2014.1)
6
+ rake (10.3.1)
7
+
8
+ PLATFORMS
9
+ x86-mingw32
10
+
11
+ DEPENDENCIES
12
+ P4Ruby-mingwx86 (~> 2014.1)
13
+ rake
data/Rakefile ADDED
@@ -0,0 +1,22 @@
1
+ require 'rake'
2
+ require './lib/p4tools/spec'
3
+
4
+ def gem_name
5
+ @gem_name ||= "#{P4Tools::PROJECT_NAME}-#{P4Tools::VERSION}"
6
+ end
7
+
8
+ task :check_version do
9
+ abort 'Update version before release!' unless %x{git tag -l #{gem_name}}.empty?
10
+ end
11
+
12
+ task :release => [:check_version] do
13
+ if system("gem build #{P4Tools::PROJECT_NAME}.gemspec")
14
+ system "git tag #{gem_name}"
15
+ system 'git push --tags'
16
+ system "gem push #{gem_name}.gem"
17
+
18
+ File.delete("#{gem_name}.gem")
19
+ end
20
+
21
+ end
22
+
@@ -1,18 +1,29 @@
1
1
  module P4Tools
2
2
  class Revert
3
+ extend CommandUtils
4
+
3
5
  def self.run(arguments)
4
6
  p4 = P4Tools.connection
5
7
  parameters = []
6
8
  parameters.push('-w') if arguments[:delete_added_files]
9
+ check_shelve = arguments[:check_shelve]
7
10
 
8
11
  if arguments[:changelists]
9
12
  parameters.push('-c').push('').push('//...')
10
13
 
11
14
  arguments[:changelists].each do |changelist|
15
+ if check_shelve && !all_files_shelved?(changelist, true)
16
+ raise(StandardError, "Not all files are shelved in changelist: #{changelist}")
17
+ end
18
+
12
19
  parameters[-2] = changelist
13
20
  p4.run_revert(parameters)
14
21
  end
15
22
  else
23
+ if check_shelve
24
+ raise(ArgumentError, "The check shelve option only works with changelists!")
25
+ end
26
+
16
27
  parameters.push(*arguments[:files])
17
28
  p4.run_revert(parameters)
18
29
  end
@@ -26,6 +37,7 @@ module P4Tools
26
37
  help 'Options:'
27
38
  help ''
28
39
  arg :delete_added_files, 'Delete added files.', :short => '-d'
40
+ arg :check_shelve, 'Check if all files shelved, before revert them.', :short => '-s'
29
41
  arg :changelists, 'Changelist numbers.', :short => '-c', :type => :ints
30
42
  arg :files, 'The absolute path of the files to delete.', :short => '-f', :type => :strings
31
43
  end
@@ -0,0 +1,4 @@
1
+ module P4Tools
2
+ PROJECT_NAME = 'p4tools'
3
+ VERSION = '0.1.4.1'
4
+ end
data/p4tools.gemspec CHANGED
@@ -1,6 +1,8 @@
1
+ require './lib/p4tools/spec'
2
+
1
3
  Gem::Specification.new do |gem|
2
- gem.name = 'p4tools'
3
- gem.version = '0.1.4'
4
+ gem.name = P4Tools::PROJECT_NAME
5
+ gem.version = P4Tools::VERSION
4
6
 
5
7
  gem.author = 'Norbert Csibra'
6
8
  gem.email = 'napispam@gmail.com'
@@ -12,4 +14,6 @@ Gem::Specification.new do |gem|
12
14
  gem.require_paths = ['lib']
13
15
 
14
16
  gem.add_runtime_dependency('P4Ruby-mingwx86', '~> 2014.1')
17
+
18
+ gem.add_development_dependency('rake', '~> 0')
15
19
  end
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: p4tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.4.1
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Norbert Csibra
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-04-23 00:00:00.000000000 Z
12
+ date: 2014-09-02 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: P4Ruby-mingwx86
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ~>
18
20
  - !ruby/object:Gem::Version
@@ -20,10 +22,27 @@ dependencies:
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - ~>
25
28
  - !ruby/object:Gem::Version
26
29
  version: '2014.1'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
27
46
  description: ! 'Simple command line tool to run custom perforce commands. '
28
47
  email: napispam@gmail.com
29
48
  executables:
@@ -31,8 +50,10 @@ executables:
31
50
  extensions: []
32
51
  extra_rdoc_files: []
33
52
  files:
53
+ - .gitignore
34
54
  - Gemfile
35
55
  - Gemfile.lock
56
+ - Rakefile
36
57
  - bin/p4tools
37
58
  - lib/commands/move.rb
38
59
  - lib/commands/revert.rb
@@ -45,31 +66,33 @@ files:
45
66
  - lib/p4tools/parsers/command_options.rb
46
67
  - lib/p4tools/parsers/command_parser.rb
47
68
  - lib/p4tools/parsers/trollop_custom.rb
69
+ - lib/p4tools/spec.rb
48
70
  - lib/p4tools/utils/command_utils.rb
49
71
  - lib/p4tools/utils/utils.rb
50
72
  - lib/p4tools/utils/validators/shelve_validator.rb
51
73
  - p4tools.gemspec
52
74
  homepage: https://github.com/ncsibra/P4Tools
53
75
  licenses: []
54
- metadata: {}
55
76
  post_install_message:
56
77
  rdoc_options: []
57
78
  require_paths:
58
79
  - lib
59
80
  required_ruby_version: !ruby/object:Gem::Requirement
81
+ none: false
60
82
  requirements:
61
83
  - - ! '>='
62
84
  - !ruby/object:Gem::Version
63
85
  version: '0'
64
86
  required_rubygems_version: !ruby/object:Gem::Requirement
87
+ none: false
65
88
  requirements:
66
89
  - - ! '>='
67
90
  - !ruby/object:Gem::Version
68
91
  version: '0'
69
92
  requirements: []
70
93
  rubyforge_project:
71
- rubygems_version: 2.2.2
94
+ rubygems_version: 1.8.23
72
95
  signing_key:
73
- specification_version: 4
96
+ specification_version: 3
74
97
  summary: Simple command line tool to run custom perforce commands.
75
98
  test_files: []
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YjdlOGJjYTY2YmM1ZGU0ODYxOWI5MmNlNDUyNjNmY2U1NzNiNTVjMg==
5
- data.tar.gz: !binary |-
6
- ZWI5Nzg0YWIyNzY0ZTNkZTMwMjVkNzBmNGVlNTE5NzI1N2ZhMDQ5Mg==
7
- SHA512:
8
- metadata.gz: !binary |-
9
- Mzc3MzE2ZjQxMjJiMTY2MjA5N2I2Y2I4NzlkZDBlZGM5NTA0MzYwMjkxOTI2
10
- ZWMyODk0NTk0YmIyY2NkYTQ4ZmZlNTVmYjFiMmVkOTcwNzQ4YjVlY2NiOTlk
11
- OWQ5ZmMwNzg5ZDMzZjhlZDk4OTQwMDk2MzIzZmQ1OTIzMzk3ZjY=
12
- data.tar.gz: !binary |-
13
- YTBiZjkzNDMzZDI1NGE3OWRmM2EzNTI4YjNhNDdkZWMzZmY5NDEwZGEwZDI3
14
- ZGE4NTRmMTIzMDU5YzM0MDcyMDEzNThjMjE2NmUyNzM0YjY0MmNkMTRhMzNl
15
- YjhmZTc0NzdjZTcyODM3MmEwN2JjMjFmMmUxN2YzMTBmYjlkNDM=