a 0.1.1 → 0.2.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 31790c6f1eeadbbe5196fbd40163244f22da5a3b
4
+ data.tar.gz: 59a6aae3ed659e5cf5763a16b5823d02963784e1
5
+ SHA512:
6
+ metadata.gz: 4fb4b11b0d763d450427dbb47166fb9bbeea37a95029ed9ea9bfa9525210fea42f4549e679aa0f48e1a3d68d9c90b31e684258eef6d4102f6444d0222d041790
7
+ data.tar.gz: ead5bae28b5e13ec3e1876c3b377fddaed72f4e6f18a02db2064ee10d97107b2bc036229a0938a4666b60378dba5e984077d7768d84e95eeef5dea97f3f61ec4
@@ -0,0 +1,14 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = "a"
3
+ s.version = "0.2.0"
4
+ s.summary = "a gem generator etc."
5
+ s.authors = ['author']
6
+
7
+ s.license = 'MIT'
8
+ s.email = 'degcat@126.com'
9
+ s.homepage = 'http://github.com'
10
+
11
+ s.files = ["a.gemspec","rakefile.rb","lib/a.rb"]
12
+ s.files += Dir["lib/commands/*.rb"]
13
+ s.executables << "a"
14
+ end
data/bin/a ADDED
@@ -0,0 +1,54 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ #ex: gem
4
+ def target
5
+
6
+ unless $*[0]
7
+ puts <<-EOT
8
+ example:
9
+ a gem mytest
10
+ will create new gem project named mytest directory
11
+
12
+ EOT
13
+ exit 1
14
+ end
15
+ t = String.new $*[0]
16
+ t.capitalize!
17
+ t
18
+ end
19
+
20
+ #ex: mytest
21
+ def dir
22
+
23
+ unless $*[1]
24
+ puts "must have mtarget_dir\nfor example:\n a gem mytest "
25
+ exit 2
26
+ end
27
+
28
+ t = String.new $*[1]
29
+
30
+ # t.capitalize!
31
+ t
32
+ end
33
+
34
+
35
+ def main
36
+
37
+ begin
38
+ require(File.join('commands',target))
39
+
40
+ rescue LoadError
41
+
42
+ puts "the #{target} not exist"
43
+ exit 4
44
+
45
+ end
46
+
47
+ target_class = Object.const_get('A::'+target)
48
+
49
+
50
+ target_class.index(dir: dir,target: target)
51
+
52
+ end
53
+
54
+ main()
data/lib/a.rb CHANGED
@@ -1,2 +1 @@
1
- module A
2
- end
1
+ # puts rand
@@ -0,0 +1,60 @@
1
+ module A
2
+ class Gem
3
+ class << self
4
+ def index(config)
5
+ dir = config[:dir]
6
+ target = config[:target]
7
+
8
+ # puts Dir.pwd
9
+
10
+ # puts target
11
+
12
+ Dir.mkdir dir rescue nil
13
+
14
+ Dir.chdir dir
15
+ Dir.mkdir 'lib' rescue nil
16
+ Dir.mkdir 'bin' rescue nil
17
+
18
+
19
+ rakefile = <<-eot
20
+ task :default do
21
+ puts `gem build #{dir}.gemspec`
22
+ if $?.success?
23
+ puts "\\nyou can install it with:"
24
+ puts "sudo gem install --local \#{Dir['*.gem'].first}"
25
+ end
26
+ end
27
+ eot
28
+ gemspec = <<-eot
29
+ Gem::Specification.new do |s|
30
+ s.name = "#{dir}"
31
+ s.version = "0.0.1"
32
+ s.summary = "summary"
33
+ s.authors = ['authors']
34
+
35
+ s.license = 'MIT'
36
+ s.email = 'degcat@126.com'
37
+ s.homepage = 'http://github.com'
38
+
39
+ s.files = Dir["lib/*.rb"]
40
+ s.executables = ["#{dir}"]
41
+ end
42
+ eot
43
+ IO.write "#{dir}.gemspec",gemspec
44
+ IO.write "rakefile.rb",rakefile
45
+ IO.write "lib/#{dir}.rb",''
46
+
47
+ binfile=<<-eot
48
+ #!/usr/bin/env ruby
49
+ puts "hello world!"
50
+ eot
51
+ IO.write "bin/#{dir}",binfile
52
+
53
+
54
+
55
+ #puts gemspec
56
+
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,6 @@
1
+ task :default do
2
+ puts `gem build a.gemspec`
3
+ puts `sudo gem i --local #{Dir["*.gem"].first}`
4
+ puts `ruby -e '' -ra`
5
+ puts `a gem mytest`
6
+ end
metadata CHANGED
@@ -1,70 +1,49 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: a
3
- version: !ruby/object:Gem::Version
4
- hash: 25
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 1
9
- - 1
10
- version: 0.1.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
11
5
  platform: ruby
12
- authors:
13
- - " Author"
6
+ authors:
7
+ - author
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2010-05-28 00:00:00 +08:00
19
- default_executable:
11
+ date: 2018-10-17 00:00:00.000000000 Z
20
12
  dependencies: []
21
-
22
13
  description:
23
- email: " Email"
24
- executables: []
25
-
14
+ email: degcat@126.com
15
+ executables:
16
+ - a
26
17
  extensions: []
27
-
28
18
  extra_rdoc_files: []
29
-
30
- files:
19
+ files:
20
+ - a.gemspec
21
+ - bin/a
31
22
  - lib/a.rb
32
- - jxyy.swf
33
- - Rakefile
34
- - README.textile
35
- has_rdoc: true
36
- homepage: http://google.com
37
- licenses: []
38
-
23
+ - lib/commands/gem.rb
24
+ - rakefile.rb
25
+ homepage: http://github.com
26
+ licenses:
27
+ - MIT
28
+ metadata: {}
39
29
  post_install_message:
40
30
  rdoc_options: []
41
-
42
- require_paths:
31
+ require_paths:
43
32
  - lib
44
- required_ruby_version: !ruby/object:Gem::Requirement
45
- none: false
46
- requirements:
33
+ required_ruby_version: !ruby/object:Gem::Requirement
34
+ requirements:
47
35
  - - ">="
48
- - !ruby/object:Gem::Version
49
- hash: 3
50
- segments:
51
- - 0
52
- version: "0"
53
- required_rubygems_version: !ruby/object:Gem::Requirement
54
- none: false
55
- requirements:
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ required_rubygems_version: !ruby/object:Gem::Requirement
39
+ requirements:
56
40
  - - ">="
57
- - !ruby/object:Gem::Version
58
- hash: 3
59
- segments:
60
- - 0
61
- version: "0"
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
62
43
  requirements: []
63
-
64
44
  rubyforge_project:
65
- rubygems_version: 1.3.7
45
+ rubygems_version: 2.5.2.3
66
46
  signing_key:
67
- specification_version: 3
68
- summary: Summary
47
+ specification_version: 4
48
+ summary: a gem generator etc.
69
49
  test_files: []
70
-
@@ -1,24 +0,0 @@
1
- h2. LICENSE:
2
-
3
- (The MIT License)
4
-
5
- Copyright (c) 2008 FIX
6
-
7
- Permission is hereby granted, free of charge, to any person obtaining
8
- a copy of this software and associated documentation files (the
9
- 'Software'), to deal in the Software without restriction, including
10
- without limitation the rights to use, copy, modify, merge, publish,
11
- distribute, sublicense, and/or sell copies of the Software, and to
12
- permit persons to whom the Software is furnished to do so, subject to
13
- the following conditions:
14
-
15
- The above copyright notice and this permission notice shall be
16
- included in all copies or substantial portions of the Software.
17
-
18
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
19
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile DELETED
@@ -1,47 +0,0 @@
1
- require 'rubygems'
2
- require 'rubygems/specification'
3
- require 'rake'
4
- require 'rake/gempackagetask'
5
- require 'spec/rake/spectask'
6
-
7
- GEM = "a"
8
- GEM_VERSION = "0.1.1"
9
- SUMMARY = " Summary"
10
- AUTHOR = " Author"
11
- EMAIL = " Email"
12
- HOMEPAGE = "http://google.com"
13
-
14
-
15
- spec = Gem::Specification.new do |s|
16
- s.name = GEM
17
- s.version = GEM_VERSION
18
- s.platform = Gem::Platform::RUBY
19
- s.summary = SUMMARY
20
- s.require_paths = ['lib']
21
- s.files = FileList['app_generators/**/*', 'bin/*', 'lib/**/*.rb', '[A-Z]*'].to_a
22
-
23
- s.author = AUTHOR
24
- s.email = EMAIL
25
- s.homepage = HOMEPAGE
26
- end
27
-
28
- Spec::Rake::SpecTask.new do |t|
29
- t.spec_files = FileList['spec/**/*_spec.rb']
30
- t.spec_opts = %w(-fs --color)
31
- end
32
-
33
- Rake::GemPackageTask.new(spec) do |pkg|
34
- pkg.gem_spec = spec
35
- end
36
-
37
- desc "Install the gem locally"
38
- task :install => [:package] do
39
- sh %{sudo gem install pkg/#{GEM}-#{GEM_VERSION}}
40
- end
41
-
42
- desc "Create a gemspec file"
43
- task :make_spec do
44
- File.open("#{GEM}.gemspec", "w") do |file|
45
- file.puts spec.to_ruby
46
- end
47
- end
data/jxyy.swf DELETED
Binary file