p4tools 0.1.2 → 0.1.4

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.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
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=
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
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
+ 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)
@@ -3,11 +3,32 @@ module P4Tools
3
3
 
4
4
  def self.run(arguments)
5
5
  @p4 = P4Tools.connection
6
- @p4.run(arguments[:raw])
6
+ command = arguments[:raw]
7
+
8
+ if help?(command)
9
+ help
10
+ else
11
+ @p4.run(command)
12
+ end
7
13
  end
8
14
 
9
15
  def self.set_options(opts)
10
16
  end
11
17
 
18
+ def self.help
19
+ $stdout.puts "\n"
20
+ $stdout.puts "Special command which delegate every argument to the perforce 'run()' method."
21
+ $stdout.puts 'This way it will behave as the command line client of perforce(p4).'
22
+ $stdout.puts "So if in the command line using a command like 'p4 revert -w -c 1234', you can use it in the exact same way with p4tools, e.g.: 'p4tools p4 revert -w -c 1234'"
23
+ $stdout.puts "For more information check the perforce command reference: http://www.perforce.com/perforce/doc.current/manuals/cmdref"
24
+ exit
25
+ end
26
+
27
+ def self.help?(command)
28
+ %w(--help -h).include?(command[0])
29
+ end
30
+
31
+ private_class_method :help?
32
+
12
33
  end
13
34
  end
@@ -52,7 +52,10 @@ module P4Tools
52
52
  }
53
53
  end
54
54
 
55
+ # @return [Hash<Symbol, Object>]
55
56
  def parse_p4_arguments
57
+ P4Delegate.help if @raw_args.empty?
58
+
56
59
  args = []
57
60
  i = 0
58
61
  current = @raw_args[i]
data/p4tools.gemspec CHANGED
@@ -1,15 +1,15 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'p4tools'
3
- gem.version = '0.1.2'
3
+ gem.version = '0.1.4'
4
4
 
5
- gem.author = ['Norbert Csibra']
5
+ gem.author = 'Norbert Csibra'
6
6
  gem.email = 'napispam@gmail.com'
7
7
  gem.homepage = 'https://github.com/ncsibra/P4Tools'
8
8
  gem.summary = 'Simple command line tool to run custom perforce commands.'
9
- gem.description = %q{Simple command line tool to run custom perforce commands. }
9
+ gem.description = 'Simple command line tool to run custom perforce commands. '
10
10
  gem.files = `git ls-files`.split($/).delete_if {|file| file =~ %r{^gem/|^lib/commands/custom/}}
11
11
  gem.executables = gem.files.grep(%r{^bin/}) { |f| File.basename(f) }
12
- gem.require_paths = ["lib"]
12
+ gem.require_paths = ['lib']
13
13
 
14
- gem.add_runtime_dependency('P4Ruby-mingwx86', "~> 2014.1")
14
+ gem.add_runtime_dependency('P4Ruby-mingwx86', '~> 2014.1')
15
15
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: p4tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
5
- prerelease:
4
+ version: 0.1.4
6
5
  platform: ruby
7
6
  authors:
8
7
  - Norbert Csibra
@@ -14,7 +13,6 @@ dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: P4Ruby-mingwx86
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -54,26 +51,25 @@ files:
54
51
  - p4tools.gemspec
55
52
  homepage: https://github.com/ncsibra/P4Tools
56
53
  licenses: []
54
+ metadata: {}
57
55
  post_install_message:
58
56
  rdoc_options: []
59
57
  require_paths:
60
58
  - lib
61
59
  required_ruby_version: !ruby/object:Gem::Requirement
62
- none: false
63
60
  requirements:
64
61
  - - ! '>='
65
62
  - !ruby/object:Gem::Version
66
63
  version: '0'
67
64
  required_rubygems_version: !ruby/object:Gem::Requirement
68
- none: false
69
65
  requirements:
70
66
  - - ! '>='
71
67
  - !ruby/object:Gem::Version
72
68
  version: '0'
73
69
  requirements: []
74
70
  rubyforge_project:
75
- rubygems_version: 1.8.23
71
+ rubygems_version: 2.2.2
76
72
  signing_key:
77
- specification_version: 3
73
+ specification_version: 4
78
74
  summary: Simple command line tool to run custom perforce commands.
79
75
  test_files: []