onecmd 0.1.0
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 +7 -0
- data/README.md +44 -0
- data/bin/onecmd +4 -0
- data/lib/onecmd.rb +13 -0
- data/lib/onecmd/command.rb +37 -0
- data/lib/onecmd/command/macosx.rb +11 -0
- data/lib/onecmd/command/macosx/hiden_files.rb +30 -0
- data/lib/onecmd/command/xcode.rb +20 -0
- data/lib/onecmd/command/xcode/rm_derived_data.rb +28 -0
- data/lib/onecmd/version.rb +3 -0
- metadata +127 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2b3ffc24dfca084b201c71be04a106da72a33f5c11a18ecca3e3eeb1a5cf8278
|
4
|
+
data.tar.gz: e0d488e03b89414ea500e6697d23d59f37274730a2283ea15253083637797906
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d32f2fde497465c8a57d86208458bae7bb5dab9745b03384a33e80e24da0ed4626397ad15e3e12351ba9c64cd789f31e79eee48044b947b2ea84f44d5f9eddde
|
7
|
+
data.tar.gz: 7a157a84b432845ff5be5b3fb19f89f3a155e64ffd7e307c3de424fbf5ea8ecb9d7961577213ebe360ff5d99a90eef47fd9833326706df74a9cf2c57c69e4514
|
data/README.md
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# Onecmd
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/onecmd`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'onecmd'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle install
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install onecmd
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/onecmd. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/onecmd/blob/master/CODE_OF_CONDUCT.md).
|
36
|
+
|
37
|
+
|
38
|
+
## License
|
39
|
+
|
40
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
41
|
+
|
42
|
+
## Code of Conduct
|
43
|
+
|
44
|
+
Everyone interacting in the Onecmd project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/onecmd/blob/master/CODE_OF_CONDUCT.md).
|
data/bin/onecmd
ADDED
data/lib/onecmd.rb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'colored2'
|
2
|
+
require 'claide'
|
3
|
+
|
4
|
+
module OneCmd
|
5
|
+
class Command < CLAide::Command
|
6
|
+
require_relative 'command/macosx'
|
7
|
+
require_relative 'command/xcode'
|
8
|
+
|
9
|
+
self.abstract_command = true
|
10
|
+
self.command = 'onecmd'
|
11
|
+
self.version = VERSION
|
12
|
+
self.description = 'a iOS dev tools cmd.'
|
13
|
+
|
14
|
+
def self.options
|
15
|
+
[
|
16
|
+
['--silent', 'Show nothing']
|
17
|
+
].concat(super)
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.run(argv)
|
21
|
+
help! 'You cannot run onecmd as root.' if Process.uid == 0 && !Gem.win_platform?
|
22
|
+
super(argv)
|
23
|
+
ensure
|
24
|
+
# Pod::UI.print_warnings
|
25
|
+
end
|
26
|
+
|
27
|
+
def initialize(argv)
|
28
|
+
super
|
29
|
+
# config.silent = argv.flag?('silent', config.silent)
|
30
|
+
# config.verbose = self.verbose? unless verbose.nil?
|
31
|
+
unless self.ansi_output?
|
32
|
+
Colored2.disable!
|
33
|
+
String.send(:define_method, :colorize) { |string, _| string }
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module OneCmd
|
2
|
+
class Command
|
3
|
+
class Macosx < Command
|
4
|
+
class HidenFiles < Macosx
|
5
|
+
self.summary = 'for mac osx system hiden files'
|
6
|
+
|
7
|
+
self.description = <<-DESC
|
8
|
+
hide/display hiden files
|
9
|
+
DESC
|
10
|
+
|
11
|
+
def self.options
|
12
|
+
[['--hide', 'hide system hiden files']].concat(super)
|
13
|
+
end
|
14
|
+
|
15
|
+
def initialize(argv)
|
16
|
+
@hide = argv.flag?('hide', true)
|
17
|
+
super
|
18
|
+
end
|
19
|
+
|
20
|
+
def run
|
21
|
+
if @hide
|
22
|
+
system('defaults write com.apple.finder AppleShowAllFiles No && killall Finder')
|
23
|
+
else
|
24
|
+
system('defaults write com.apple.finder AppleShowAllFiles Yes && killall Finder')
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
require_relative 'xcode/rm_derived_data'
|
3
|
+
|
4
|
+
module OneCmd
|
5
|
+
class Command
|
6
|
+
class Xcode < Command
|
7
|
+
self.abstract_command = true
|
8
|
+
|
9
|
+
self.summary = 'for xcode ide'
|
10
|
+
# self.default_subcommand = 'list'
|
11
|
+
|
12
|
+
# extend Executable
|
13
|
+
# executable :git
|
14
|
+
|
15
|
+
def dir
|
16
|
+
# config.repos_dir + @name
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module OneCmd
|
2
|
+
class Command
|
3
|
+
class Xcode < Command
|
4
|
+
class RmDerivedData < Xcode
|
5
|
+
self.summary = 'for xcode derived data'
|
6
|
+
|
7
|
+
self.description = <<-DESC
|
8
|
+
eg. remove user's derived data
|
9
|
+
DESC
|
10
|
+
|
11
|
+
def self.options
|
12
|
+
[['--count-only', 'Show the total number of repos']].concat(super)
|
13
|
+
end
|
14
|
+
|
15
|
+
def initialize(argv)
|
16
|
+
@count_only = argv.flag?('count-only')
|
17
|
+
super
|
18
|
+
end
|
19
|
+
|
20
|
+
def run
|
21
|
+
path = "#{ENV['HOME']}/Library/Developer/Xcode/DerivedData"
|
22
|
+
FileUtils.rm_rf(path)
|
23
|
+
puts "✅ rm derived data: #{path}"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,127 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: onecmd
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- xiongzenghui
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-03-02 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: cocoapods
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.6.0
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '2.0'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.6.0
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '2.0'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: gitlab
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 4.11.0
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 4.11.0
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: jenkins_api_client
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 1.5.3
|
54
|
+
- - "<"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '2.0'
|
57
|
+
type: :runtime
|
58
|
+
prerelease: false
|
59
|
+
version_requirements: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: 1.5.3
|
64
|
+
- - "<"
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '2.0'
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: formatador
|
69
|
+
requirement: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: 0.2.5
|
74
|
+
- - "<"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '1.0'
|
77
|
+
type: :runtime
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: 0.2.5
|
84
|
+
- - "<"
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '1.0'
|
87
|
+
description: a iOS dev comand line tools
|
88
|
+
email:
|
89
|
+
- zxcvb1234001@163.com
|
90
|
+
executables:
|
91
|
+
- onecmd
|
92
|
+
extensions: []
|
93
|
+
extra_rdoc_files: []
|
94
|
+
files:
|
95
|
+
- README.md
|
96
|
+
- bin/onecmd
|
97
|
+
- lib/onecmd.rb
|
98
|
+
- lib/onecmd/command.rb
|
99
|
+
- lib/onecmd/command/macosx.rb
|
100
|
+
- lib/onecmd/command/macosx/hiden_files.rb
|
101
|
+
- lib/onecmd/command/xcode.rb
|
102
|
+
- lib/onecmd/command/xcode/rm_derived_data.rb
|
103
|
+
- lib/onecmd/version.rb
|
104
|
+
homepage: https://github.com/xzhhe/onecmd
|
105
|
+
licenses:
|
106
|
+
- MIT
|
107
|
+
metadata: {}
|
108
|
+
post_install_message:
|
109
|
+
rdoc_options: []
|
110
|
+
require_paths:
|
111
|
+
- lib
|
112
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: 2.3.0
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
122
|
+
requirements: []
|
123
|
+
rubygems_version: 3.0.4
|
124
|
+
signing_key:
|
125
|
+
specification_version: 4
|
126
|
+
summary: a iOS dev comand line tools
|
127
|
+
test_files: []
|