kp-utils 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/KP-utils.gemspec +27 -0
- data/LICENSE.txt +21 -0
- data/README.md +49 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/.DS_Store +0 -0
- data/lib/KP/utils.rb +18 -0
- data/lib/KP/utils/.DS_Store +0 -0
- data/lib/KP/utils/engine.rb +11 -0
- data/lib/KP/utils/version.rb +5 -0
- data/lib/tasks/github.rake +34 -0
- metadata +102 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1b15c132f324ca9897b3d51ee1a14c455820df1f
|
4
|
+
data.tar.gz: 9b9e8d552b853c9dcae752374d4482b3e745e259
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c39ba2e3bdbf5221a22fe964f943851a81486fe5b9a2e3f9610ae2a386f12046fb184948ed60f8674b11078d976c22b40398e7bb40e7a7b4c10391c9577aff78
|
7
|
+
data.tar.gz: c87a21306c80fd748d206bfa59f2dec4f0c1fed095f94d426ef742b601a3dc09aaae308d361c2b61daae5852589984572ff7430cdafe9b7b87c88c81430d2add
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/KP-utils.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'KP/utils/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "kp-utils"
|
8
|
+
spec.version = KP::Utils::VERSION
|
9
|
+
spec.authors = ["Justin Grubbs"]
|
10
|
+
spec.email = ["justin@kingandpartners.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{commonly used rake tasks and other goodies we use all the time}
|
13
|
+
spec.description = %q{commonly used rake tasks and other goodies we use all the time}
|
14
|
+
spec.homepage = "https://github.com/kingandpartners/kp-utils"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
spec.bindir = "exe"
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.14"
|
25
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
27
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Justin Grubbs
|
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,49 @@
|
|
1
|
+
# KP::Utils
|
2
|
+
|
3
|
+
A collection of rake tasks and other goodies (to come soon) that we commone use at King & Partners
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'kp-utils'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install kp-utils
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Create an initializer. **config/initializers/kp_utils.rb**
|
24
|
+
```ruby
|
25
|
+
KP::Utils.configure do |config|
|
26
|
+
|
27
|
+
config.github = {
|
28
|
+
repo_owner: 'owner',
|
29
|
+
repo_name: 'repo',
|
30
|
+
deploy_token: '****************************************'
|
31
|
+
}
|
32
|
+
|
33
|
+
end
|
34
|
+
```
|
35
|
+
|
36
|
+
## Github Releaser
|
37
|
+
|
38
|
+
```
|
39
|
+
$ rake github:create_release
|
40
|
+
```
|
41
|
+
|
42
|
+
## Contributing
|
43
|
+
|
44
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/KP-utils.
|
45
|
+
|
46
|
+
## License
|
47
|
+
|
48
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
49
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "KP/utils"
|
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
data/lib/.DS_Store
ADDED
Binary file
|
data/lib/KP/utils.rb
ADDED
Binary file
|
@@ -0,0 +1,34 @@
|
|
1
|
+
namespace :github do
|
2
|
+
|
3
|
+
desc "creating new release in github"
|
4
|
+
task create_release: :environment do
|
5
|
+
|
6
|
+
begin
|
7
|
+
owner = KP::Utils.github[:repo_owner]
|
8
|
+
repo = KP::Utils.github[:repo_name]
|
9
|
+
token = KP::Utils.github[:deploy_token]
|
10
|
+
auth = "-H 'Authorization: token #{token}'"
|
11
|
+
|
12
|
+
current_branch = `git rev-parse --abbrev-ref HEAD`
|
13
|
+
target = Rails.env.production? ? 'master' : current_branch.try(:strip) || 'develop'
|
14
|
+
prerelease = !Rails.env.production?
|
15
|
+
|
16
|
+
params = {
|
17
|
+
tag_name: "#{target}-#{Time.now.strftime('%F-%H-%M-%S')}",
|
18
|
+
target_commitish: target,
|
19
|
+
name: "#{Rails.env.upcase} DEPLOY: #{Time.now.strftime('%A : %B %e, %Y : %R')}",
|
20
|
+
draft: false,
|
21
|
+
prerelease: prerelease
|
22
|
+
#body: 'Description of the release', # FIX ME: to do: add commits of release diff
|
23
|
+
}
|
24
|
+
|
25
|
+
system "curl #{auth} https://api.github.com/repos/#{owner}/#{repo}/releases -d '#{params.to_json}'"
|
26
|
+
rescue Exception => e
|
27
|
+
puts "Failure: Could not create release"
|
28
|
+
puts "Error: #{e.inspect}"
|
29
|
+
ensure
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
metadata
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: kp-utils
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Justin Grubbs
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-02-24 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.14'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.14'
|
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: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
description: commonly used rake tasks and other goodies we use all the time
|
56
|
+
email:
|
57
|
+
- justin@kingandpartners.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- ".rspec"
|
64
|
+
- ".travis.yml"
|
65
|
+
- Gemfile
|
66
|
+
- KP-utils.gemspec
|
67
|
+
- LICENSE.txt
|
68
|
+
- README.md
|
69
|
+
- Rakefile
|
70
|
+
- bin/console
|
71
|
+
- bin/setup
|
72
|
+
- lib/.DS_Store
|
73
|
+
- lib/KP/utils.rb
|
74
|
+
- lib/KP/utils/.DS_Store
|
75
|
+
- lib/KP/utils/engine.rb
|
76
|
+
- lib/KP/utils/version.rb
|
77
|
+
- lib/tasks/github.rake
|
78
|
+
homepage: https://github.com/kingandpartners/kp-utils
|
79
|
+
licenses:
|
80
|
+
- MIT
|
81
|
+
metadata: {}
|
82
|
+
post_install_message:
|
83
|
+
rdoc_options: []
|
84
|
+
require_paths:
|
85
|
+
- lib
|
86
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
requirements: []
|
97
|
+
rubyforge_project:
|
98
|
+
rubygems_version: 2.4.8
|
99
|
+
signing_key:
|
100
|
+
specification_version: 4
|
101
|
+
summary: commonly used rake tasks and other goodies we use all the time
|
102
|
+
test_files: []
|