jar_download 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d2bad85e9f65a94fce27289fc39f759a3ee2d201
4
+ data.tar.gz: 10dd558b0188c083b32d90e923f9c1b11109b2e4
5
+ SHA512:
6
+ metadata.gz: 505d7905a7bdfe0070d678de0426e3daeee6f500f29d1864261b671f76fced07cb95d04d2b975aab500a0309118a0539eba995bfe9bab3c2d12ba5c9264460a2
7
+ data.tar.gz: fb4a698d0f68983463b56b97f0a02557860bf7f368ac621f1505607ff8464ccbb587cdd7a1e31c59b755cb41605d1e4afab4fb4c3e6e2b961ca73c9903fe678d
@@ -0,0 +1,84 @@
1
+ .DS_Store
2
+ results.html
3
+ pkg
4
+ html
5
+ #### joe made this: http://goel.io/joe
6
+
7
+ #####=== Ruby ===#####
8
+
9
+ *.gem
10
+ *.rbc
11
+ /.config
12
+ /coverage/
13
+ /InstalledFiles
14
+ /pkg/
15
+ /spec/reports/
16
+ /test/tmp/
17
+ /test/version_tmp/
18
+ /tmp/
19
+
20
+ ## Specific to RubyMotion:
21
+ .dat*
22
+ .repl_history
23
+ build/
24
+
25
+ ## Documentation cache and generated files:
26
+ /.yardoc/
27
+ /_yardoc/
28
+ /doc/
29
+ /rdoc/
30
+
31
+ ## Environment normalisation:
32
+ /.bundle/
33
+ /vendor/bundle
34
+ /lib/bundler/man/
35
+
36
+ # for a library or gem, you might want to ignore these files since the code is
37
+ # intended to run in multiple environments; otherwise, check them in:
38
+ # Gemfile.lock
39
+ # .ruby-version
40
+ # .ruby-gemset
41
+
42
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
43
+ .rvmrc
44
+
45
+ #### joe made this: http://goel.io/joe
46
+
47
+ #####=== Vim ===#####
48
+ [._]*.s[a-w][a-z]
49
+ [._]s[a-w][a-z]
50
+ *.un~
51
+ Session.vim
52
+ .netrwhist
53
+ *~
54
+
55
+ #### joe made this: http://goel.io/joe
56
+
57
+ #####=== OSX ===#####
58
+ .DS_Store
59
+ .AppleDouble
60
+ .LSOverride
61
+
62
+ # Icon must end with two \r
63
+ Icon
64
+
65
+ # Thumbnails
66
+ ._*
67
+
68
+ # Files that might appear in the root of a volume
69
+ .DocumentRevisions-V100
70
+ .fseventsd
71
+ .Spotlight-V100
72
+ .TemporaryItems
73
+ .Trashes
74
+ .VolumeIcon.icns
75
+
76
+ # Directories potentially created on remote AFP share
77
+ .AppleDB
78
+ .AppleDesktop
79
+ Network Trash Folder
80
+ Temporary Items
81
+ .apdisk
82
+
83
+ idea/
84
+ *.jar
@@ -0,0 +1 @@
1
+ jar_download
@@ -0,0 +1 @@
1
+ 2.1.5
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.5
4
+ before_install: gem install bundler -v 1.10.6
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in jar_download.gemspec
4
+ gemspec
@@ -0,0 +1,56 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ jar_download (0.1.0)
5
+ methadone (~> 1.9.3)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ aruba (0.14.2)
11
+ childprocess (~> 0.5.6)
12
+ contracts (~> 0.9)
13
+ cucumber (>= 1.3.19)
14
+ ffi (~> 1.9.10)
15
+ rspec-expectations (>= 2.99)
16
+ thor (~> 0.19)
17
+ builder (3.2.2)
18
+ childprocess (0.5.9)
19
+ ffi (~> 1.0, >= 1.0.11)
20
+ contracts (0.14.0)
21
+ cucumber (2.4.0)
22
+ builder (>= 2.1.2)
23
+ cucumber-core (~> 1.5.0)
24
+ cucumber-wire (~> 0.0.1)
25
+ diff-lcs (>= 1.1.3)
26
+ gherkin (~> 4.0)
27
+ multi_json (>= 1.7.5, < 2.0)
28
+ multi_test (>= 0.1.2)
29
+ cucumber-core (1.5.0)
30
+ gherkin (~> 4.0)
31
+ cucumber-wire (0.0.1)
32
+ diff-lcs (1.2.5)
33
+ ffi (1.9.14)
34
+ gherkin (4.0.0)
35
+ methadone (1.9.3)
36
+ bundler
37
+ multi_json (1.12.1)
38
+ multi_test (0.1.2)
39
+ rake (10.5.0)
40
+ rspec-expectations (3.5.0)
41
+ diff-lcs (>= 1.2.0, < 2.0)
42
+ rspec-support (~> 3.5.0)
43
+ rspec-support (3.5.0)
44
+ thor (0.19.4)
45
+
46
+ PLATFORMS
47
+ ruby
48
+
49
+ DEPENDENCIES
50
+ aruba
51
+ bundler (~> 1.10)
52
+ jar_download!
53
+ rake (~> 10.0)
54
+
55
+ BUNDLED WITH
56
+ 1.13.6
@@ -0,0 +1,8 @@
1
+ Name: jar_download
2
+ Copyright (c) 2016 xiajian
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+
6
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,41 @@
1
+ # JarDownload
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/jar_download`. 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 'jar_download'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install jar_download
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 false` 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]/jar_download. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
36
+
37
+
38
+ ## License
39
+
40
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
+
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "jar_download"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'optparse'
4
+ require 'methadone'
5
+ require "bundler/setup"
6
+ require 'jar_download'
7
+
8
+ class App
9
+ include Methadone::Main
10
+ include Methadone::CLILogging
11
+
12
+ main do |args|
13
+ if ARGV.empty? || ARGV.length < 3
14
+ puts 'Usage "jar_download jar_name group_id version"'
15
+ puts ' "jar_download -h" for more infomation'
16
+ exit 1
17
+ end
18
+
19
+ jar_info = {
20
+ jar_name: ARGV[0],
21
+ group_id: ARGV[1],
22
+ version: ARGV[2]
23
+ }
24
+
25
+ puts jar_info
26
+
27
+ JarDownload.command jar_info
28
+ end
29
+
30
+ # supplemental methods here
31
+
32
+ # Declare command-line interface here
33
+
34
+ # description "one line description of your app"
35
+ #
36
+ # Accept flags via:
37
+ # on("--flag VAL","Some flag")
38
+ # options[flag] will contain VAL
39
+ #
40
+ # Specify switches via:
41
+ # on("--[no-]switch","Some switch")
42
+ #
43
+ # Or, just call OptionParser methods on opts
44
+ #
45
+ # Require an argument
46
+ # arg :some_arg
47
+ #
48
+ # # Make an argument optional
49
+ # arg :optional_arg, :optional
50
+
51
+ version JarDownload::VERSION
52
+
53
+ description 'jar download is used to download jar file from maven repoistroy'
54
+
55
+ # 设置开关选项
56
+ # arg :args, :required
57
+
58
+ on("--verbose","Be verbose")
59
+
60
+ use_log_level_option :toggle_debug_on_signal => 'USR1'
61
+
62
+ go!
63
+ end
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,34 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'jar_download/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "jar_download"
8
+ spec.version = JarDownload::VERSION
9
+ spec.authors = ["xiajian"]
10
+ spec.email = ["jhqy2011@gmail.com"]
11
+
12
+ spec.summary = %q{jar download is used to download jar file from maven repoistroy}
13
+ spec.description = %q{jar download is used to download jar file from maven repoistroy}
14
+ spec.homepage = "https://github.com/xiajian/jar_download"
15
+ spec.license = "mit"
16
+
17
+ # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
18
+ # delete this section to allow pushing this gem to any host.
19
+ if spec.respond_to?(:metadata)
20
+ spec.metadata['allowed_push_host'] = "https://rubygems.org"
21
+ else
22
+ raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
23
+ end
24
+
25
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
+ spec.bindir = "bin"
27
+ spec.executables = ["jar_download"]
28
+ spec.require_paths = ["lib"]
29
+
30
+ spec.add_development_dependency "bundler", "~> 1.10"
31
+ spec.add_development_dependency "rake", "~> 10.0"
32
+ spec.add_development_dependency('aruba')
33
+ spec.add_dependency('methadone', '~> 1.9.3')
34
+ end
@@ -0,0 +1,48 @@
1
+ require "jar_download/version"
2
+ require "erb"
3
+ require "fileutils"
4
+
5
+ module JarDownload
6
+
7
+ class PomXML
8
+ attr_accessor :group_id, :jar_name, :version
9
+
10
+ def initialize(jar_info = {})
11
+ @group_id, @jar_name, @version = jar_info[:group_id], jar_info[:jar_name], jar_info[:version]
12
+ end
13
+ end
14
+
15
+ def get_jar_info
16
+ {
17
+ group_id: 'mysql',
18
+ jar_name: 'mysql-connector-java',
19
+ version: '5.1.27'
20
+ }
21
+ end
22
+
23
+ def generate_pom_xml(jar_info = get_jar_info)
24
+ filename = File.join(File.dirname(__FILE__), "jar_download/pom.xml.erb")
25
+ erb = ERB.new(File.read(filename))
26
+ erb.filename = filename
27
+ pom_xml = erb.def_class(PomXML, 'render()')
28
+
29
+ result = pom_xml.new(jar_info).render()
30
+
31
+ p result
32
+
33
+ result
34
+ end
35
+
36
+ def command(jar_info = get_jar_info)
37
+ FileUtils.mkdir_p("/tmp/jar_download")
38
+ pwd = FileUtils.pwd
39
+
40
+ File.open '/tmp/jar_download/pom.xml', 'w' do |file|
41
+ file.write generate_pom_xml(jar_info)
42
+ end
43
+
44
+ system "cd /tmp/jar_download; mvn -f pom.xml dependency:copy-dependencies; cp -r target/dependency/*.jar #{pwd}"
45
+ end
46
+
47
+ extend self
48
+ end
@@ -0,0 +1,15 @@
1
+ <?xml version="1.0"?>
2
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3
+
4
+ <modelVersion>4.0.0</modelVersion>
5
+ <groupId>temp.download</groupId>
6
+ <artifactId>temp-download</artifactId>
7
+ <version>1.0-SNAPSHOT</version>
8
+ <dependencies>
9
+ <dependency>
10
+ <groupId><%= group_id %></groupId>
11
+ <artifactId><%= jar_name %></artifactId>
12
+ <version><%= version %></version>
13
+ </dependency>
14
+ </dependencies>
15
+ </project>
@@ -0,0 +1,3 @@
1
+ module JarDownload
2
+ VERSION = "0.1.0"
3
+ end
metadata ADDED
@@ -0,0 +1,119 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jar_download
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - xiajian
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-12-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: aruba
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: methadone
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 1.9.3
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 1.9.3
69
+ description: jar download is used to download jar file from maven repoistroy
70
+ email:
71
+ - jhqy2011@gmail.com
72
+ executables:
73
+ - jar_download
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - ".gitignore"
78
+ - ".ruby-gemset"
79
+ - ".ruby-version"
80
+ - ".travis.yml"
81
+ - CODE_OF_CONDUCT.md
82
+ - Gemfile
83
+ - Gemfile.lock
84
+ - LICENSE.txt
85
+ - README.md
86
+ - Rakefile
87
+ - bin/console
88
+ - bin/jar_download
89
+ - bin/setup
90
+ - jar_download.gemspec
91
+ - lib/jar_download.rb
92
+ - lib/jar_download/pom.xml.erb
93
+ - lib/jar_download/version.rb
94
+ homepage: https://github.com/xiajian/jar_download
95
+ licenses:
96
+ - mit
97
+ metadata:
98
+ allowed_push_host: https://rubygems.org
99
+ post_install_message:
100
+ rdoc_options: []
101
+ require_paths:
102
+ - lib
103
+ required_ruby_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ required_rubygems_version: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
113
+ requirements: []
114
+ rubyforge_project:
115
+ rubygems_version: 2.6.6
116
+ signing_key:
117
+ specification_version: 4
118
+ summary: jar download is used to download jar file from maven repoistroy
119
+ test_files: []