rake-dependencies 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9152da4ea5be88e6a3c8133c459b84e28a882999
4
+ data.tar.gz: 89438dee32487d5c7367f828e17b323dece0a358
5
+ SHA512:
6
+ metadata.gz: 120bd0ebb52be42f89fab5bbc3418c4d70a28862398a688ea58b9b635c8d5f6ee579c490eb1d4e2de602db28f71c062bca3c9900f44fbf77861ee7abe255f3f7
7
+ data.tar.gz: 94b1cf91a311d75d7c90944fb72332a6c095ca700dc5e5179c689f23ba666edbe26bf945d22cadfe649aad37e7f87d6f9e9f0e40ec62ae0beceb144ed0458532
data/.gitignore ADDED
@@ -0,0 +1,30 @@
1
+ ## Standard stuff:
2
+ *.gem
3
+ *.rbc
4
+ /.config
5
+ /coverage/
6
+ /InstalledFiles
7
+ /pkg/
8
+ .rspec_status
9
+ /spec/reports/
10
+ /spec/examples.txt
11
+ /test/tmp/
12
+ /test/version_tmp/
13
+ /tmp/
14
+
15
+ ## Documentation cache and generated files:
16
+ /.yardoc/
17
+ /_yardoc/
18
+ /doc/
19
+ /rdoc/
20
+
21
+ ## Environment normalization:
22
+ /.bundle/
23
+ /vendor/bundle
24
+ /lib/bundler/man/
25
+
26
+ ## IDE:
27
+ .idea
28
+ *.ipr
29
+ *.iws
30
+ *.iml
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.0.0-p648
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at tobyclemson@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in rake_dependencies.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,67 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ rake-dependencies (0.3.0)
5
+ hamster (~> 3.0)
6
+ mattock (~> 0.10)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ activesupport (4.2.7.1)
12
+ i18n (~> 0.7)
13
+ json (~> 1.7, >= 1.7.7)
14
+ minitest (~> 5.1)
15
+ thread_safe (~> 0.3, >= 0.3.4)
16
+ tzinfo (~> 1.1)
17
+ calibrate (0.0.1)
18
+ caliph (0.3.1)
19
+ concurrent-ruby (1.0.2)
20
+ diff-lcs (1.3)
21
+ fakefs (0.10.2)
22
+ gem-release (0.7.4)
23
+ hamster (3.0.0)
24
+ concurrent-ruby (~> 1.0)
25
+ i18n (0.8.0)
26
+ json (1.8.6)
27
+ mattock (0.10.1)
28
+ calibrate (~> 0.0.1)
29
+ caliph (~> 0.3)
30
+ rake (~> 10.0)
31
+ tilt (> 0)
32
+ valise (~> 1.1)
33
+ minitest (5.10.1)
34
+ rake (10.5.0)
35
+ rspec (3.5.0)
36
+ rspec-core (~> 3.5.0)
37
+ rspec-expectations (~> 3.5.0)
38
+ rspec-mocks (~> 3.5.0)
39
+ rspec-core (3.5.4)
40
+ rspec-support (~> 3.5.0)
41
+ rspec-expectations (3.5.0)
42
+ diff-lcs (>= 1.2.0, < 2.0)
43
+ rspec-support (~> 3.5.0)
44
+ rspec-mocks (3.5.0)
45
+ diff-lcs (>= 1.2.0, < 2.0)
46
+ rspec-support (~> 3.5.0)
47
+ rspec-support (3.5.0)
48
+ thread_safe (0.3.5)
49
+ tilt (2.0.6)
50
+ tzinfo (1.2.2)
51
+ thread_safe (~> 0.1)
52
+ valise (1.2.1)
53
+
54
+ PLATFORMS
55
+ ruby
56
+
57
+ DEPENDENCIES
58
+ activesupport (~> 4.2)
59
+ bundler (~> 1.14)
60
+ fakefs (~> 0.10)
61
+ gem-release (~> 0.7)
62
+ rake (~> 10.0)
63
+ rake-dependencies!
64
+ rspec (~> 3.0)
65
+
66
+ BUNDLED WITH
67
+ 1.14.3
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Toby Clemson
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # RakeDependencies
2
+
3
+ Rake tasks for managing build dependencies.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'rake_dependencies'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install rake_dependencies
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Development
26
+
27
+ 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.
28
+
29
+ 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).
30
+
31
+ ## Contributing
32
+
33
+ Bug reports and pull requests are welcome on GitHub at https://github.com/tobyclemson/rake_dependencies. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
34
+
35
+
36
+ ## License
37
+
38
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
39
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "rake_dependencies"
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(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,6 @@
1
+ require 'rake_dependencies/tasks'
2
+ require 'rake_dependencies/template'
3
+ require 'rake_dependencies/version'
4
+
5
+ module RakeDependencies
6
+ end
@@ -0,0 +1,2 @@
1
+ require_relative 'tasks/clean'
2
+ require_relative 'tasks/download'
@@ -0,0 +1,23 @@
1
+ require 'mattock'
2
+
3
+ module RakeDependencies
4
+ module Tasks
5
+ class Clean < Mattock::Tasklib
6
+ setting :name, :clean
7
+ required_fields :path
8
+ required_fields :dependency
9
+
10
+ def default_configuration(*args)
11
+ super(args)
12
+ self.name = args[0] if args[0]
13
+ end
14
+
15
+ def define
16
+ desc "Clean vendored #{dependency}"
17
+ task name do
18
+ rm_rf path
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,63 @@
1
+ require 'mattock'
2
+ require 'open-uri'
3
+ require_relative '../template'
4
+
5
+ module RakeDependencies
6
+ module Tasks
7
+ class Download < Mattock::Tasklib
8
+ extend FileUtils
9
+
10
+ setting :name, :download
11
+ setting :type, :zip
12
+ setting :directory, 'dist'
13
+ required_fields :path
14
+ required_fields :dependency
15
+ required_fields :version
16
+ required_fields :uri_template
17
+ required_fields :file_name_template
18
+
19
+ def default_configuration(*args)
20
+ super(args)
21
+ self.name = args[0] if args[0]
22
+ end
23
+
24
+ def define
25
+ desc "Download #{dependency} distribution"
26
+ task name do
27
+ parameters = {version: version, os: os, ext: ext}
28
+
29
+ uri = Template.new(uri_template)
30
+ .with_parameters(parameters)
31
+ .render
32
+ download_file_name = Template.new(file_name_template)
33
+ .with_parameters(parameters)
34
+ .render
35
+ download_file_directory = File.join(path, directory)
36
+ download_file_path = File.join(download_file_directory, download_file_name)
37
+
38
+ temporary_file = open(uri)
39
+
40
+ mkdir_p download_file_directory
41
+ cp temporary_file.path, download_file_path
42
+ end
43
+ end
44
+
45
+ private
46
+
47
+ def os
48
+ RUBY_PLATFORM =~ /darwin/ ? :mac : :linux
49
+ end
50
+
51
+ def ext
52
+ case type.to_sym
53
+ when :tar_gz then '.tar.gz'
54
+ when :tgz then '.tgz'
55
+ when :zip then '.zip'
56
+ when :uncompressed then ''
57
+ else
58
+ raise "Unknown type: #{type}"
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,31 @@
1
+ require 'hamster'
2
+
3
+ module RakeDependencies
4
+ class Template
5
+ def initialize(
6
+ template,
7
+ parameters = {})
8
+ @template = template
9
+ @parameters = Hamster::Hash.new(parameters)
10
+ end
11
+
12
+ def with_parameter key, value
13
+ Template.new(@template, @parameters.put(key, value))
14
+ end
15
+
16
+ def with_parameters **pairs
17
+ pairs.to_a.reduce(self) do |memo, parameter|
18
+ memo.with_parameter(*parameter)
19
+ end
20
+ end
21
+
22
+ def render
23
+ context = Object.new
24
+ @parameters.each do |key, value|
25
+ context.instance_variable_set("@#{key}", value)
26
+ end
27
+ context_binding = context.instance_eval { binding }
28
+ ERB.new(@template).result(context_binding)
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,3 @@
1
+ module RakeDependencies
2
+ VERSION = "0.3.0"
3
+ end
@@ -0,0 +1,36 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'rake_dependencies/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'rake-dependencies'
8
+ spec.version = RakeDependencies::VERSION
9
+ spec.authors = ['Toby Clemson']
10
+ spec.email = ['tobyclemson@gmail.com']
11
+
12
+ spec.date = '2017-01-31'
13
+ spec.summary = 'Rake tasks for managing build dependencies.'
14
+ spec.description = 'Provides rake tasks for downloading and extracting tools depended on for further build activities.'
15
+ spec.homepage = 'https://github.com/tobyclemson/rake_dependencies'
16
+ spec.license = 'MIT'
17
+
18
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
19
+ f.match(%r{^(test|spec|features)/})
20
+ end
21
+ spec.bindir = 'exe'
22
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
+ spec.require_paths = ['lib']
24
+
25
+ spec.required_ruby_version = '>= 2.0'
26
+
27
+ spec.add_dependency 'hamster', '~> 3.0'
28
+ spec.add_dependency 'mattock', '~> 0.10'
29
+
30
+ spec.add_development_dependency 'bundler', '~> 1.14'
31
+ spec.add_development_dependency 'rake', '~> 10.0'
32
+ spec.add_development_dependency 'rspec', '~> 3.0'
33
+ spec.add_development_dependency 'gem-release', '~> 0.7'
34
+ spec.add_development_dependency 'activesupport', '~> 4.2'
35
+ spec.add_development_dependency 'fakefs', '~> 0.10'
36
+ end
metadata ADDED
@@ -0,0 +1,175 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rake-dependencies
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
5
+ platform: ruby
6
+ authors:
7
+ - Toby Clemson
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-01-31 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: hamster
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '3.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '3.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: mattock
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '0.10'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '0.10'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '1.14'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '1.14'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '10.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '10.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: '3.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: '3.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: gem-release
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: '0.7'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: '0.7'
97
+ - !ruby/object:Gem::Dependency
98
+ name: activesupport
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ~>
102
+ - !ruby/object:Gem::Version
103
+ version: '4.2'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ~>
109
+ - !ruby/object:Gem::Version
110
+ version: '4.2'
111
+ - !ruby/object:Gem::Dependency
112
+ name: fakefs
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
117
+ version: '0.10'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ~>
123
+ - !ruby/object:Gem::Version
124
+ version: '0.10'
125
+ description: Provides rake tasks for downloading and extracting tools depended on
126
+ for further build activities.
127
+ email:
128
+ - tobyclemson@gmail.com
129
+ executables: []
130
+ extensions: []
131
+ extra_rdoc_files: []
132
+ files:
133
+ - .gitignore
134
+ - .rspec
135
+ - .ruby-version
136
+ - CODE_OF_CONDUCT.md
137
+ - Gemfile
138
+ - Gemfile.lock
139
+ - LICENSE.txt
140
+ - README.md
141
+ - Rakefile
142
+ - bin/console
143
+ - bin/setup
144
+ - lib/rake_dependencies.rb
145
+ - lib/rake_dependencies/tasks.rb
146
+ - lib/rake_dependencies/tasks/clean.rb
147
+ - lib/rake_dependencies/tasks/download.rb
148
+ - lib/rake_dependencies/template.rb
149
+ - lib/rake_dependencies/version.rb
150
+ - rake_dependencies.gemspec
151
+ homepage: https://github.com/tobyclemson/rake_dependencies
152
+ licenses:
153
+ - MIT
154
+ metadata: {}
155
+ post_install_message:
156
+ rdoc_options: []
157
+ require_paths:
158
+ - lib
159
+ required_ruby_version: !ruby/object:Gem::Requirement
160
+ requirements:
161
+ - - '>='
162
+ - !ruby/object:Gem::Version
163
+ version: '2.0'
164
+ required_rubygems_version: !ruby/object:Gem::Requirement
165
+ requirements:
166
+ - - '>='
167
+ - !ruby/object:Gem::Version
168
+ version: '0'
169
+ requirements: []
170
+ rubyforge_project:
171
+ rubygems_version: 2.6.6
172
+ signing_key:
173
+ specification_version: 4
174
+ summary: Rake tasks for managing build dependencies.
175
+ test_files: []