satorix-common 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/.gitlab-ci.yml +26 -0
- data/.rspec +3 -0
- data/.ruby-version +1 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +22 -0
- data/Procfile +1 -0
- data/README.md +50 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/satorix/common/console.rb +180 -0
- data/lib/satorix/common/pricing.rb +149 -0
- data/lib/satorix/common/version.rb +5 -0
- data/lib/satorix/common.rb +13 -0
- data/satorix/CI/deploy/rubygems.rb +77 -0
- data/satorix/custom.rb +21 -0
- data/satorix-common.gemspec +40 -0
- metadata +76 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9b9ccf26bc69123cd3eb6ac5d31fcff948856ebc2f2f8dbd41dc8bb381f6d99f
|
4
|
+
data.tar.gz: de54faed6d36638dc44a0b89d9b9a08566c604210b42daab6cfaea046a4b131e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4c5beb573b3b58aed5cee2755e1e6d5bfa2be2e2c0a5364358173f903d921cc5e86a7b969a27ad68bab1d4be309104a79cdbad773ef1ba165803f04403274102
|
7
|
+
data.tar.gz: 8384f64de67396d560f99ab6ee66995b6ff44cd56ae5b0d1d599f9b46cd9d505dc444e07c9002874372dbbaaae1a32a14a1ce37decc8747e75b0563ed4b97501
|
data/.gitignore
ADDED
data/.gitlab-ci.yml
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
image: 'satorix/base'
|
2
|
+
|
3
|
+
cache:
|
4
|
+
key: "$CI_PROJECT_ID"
|
5
|
+
paths:
|
6
|
+
- 'tmp/satorix/cache' # To cache buildpack gems between runs.
|
7
|
+
|
8
|
+
|
9
|
+
.satorix: &satorix
|
10
|
+
script:
|
11
|
+
- gem install satorix --source https://gems.iexposure.com --no-document
|
12
|
+
- satorix
|
13
|
+
|
14
|
+
|
15
|
+
rspec:
|
16
|
+
<<: *satorix
|
17
|
+
|
18
|
+
|
19
|
+
# This is a custom job, defined at satorix/CI/deploy/rubygems.rb
|
20
|
+
deploy_to_rubygems:
|
21
|
+
stage: deploy
|
22
|
+
only:
|
23
|
+
- tags
|
24
|
+
except:
|
25
|
+
- schedules
|
26
|
+
<<: *satorix
|
data/.rspec
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.6.5
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
satorix-common (1.1.5)
|
5
|
+
rake
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://gems.iexposure.com/
|
9
|
+
specs:
|
10
|
+
rake (13.0.1)
|
11
|
+
|
12
|
+
PLATFORMS
|
13
|
+
ruby
|
14
|
+
|
15
|
+
DEPENDENCIES
|
16
|
+
satorix-common!
|
17
|
+
|
18
|
+
RUBY VERSION
|
19
|
+
ruby 2.6.5p114
|
20
|
+
|
21
|
+
BUNDLED WITH
|
22
|
+
1.17.3
|
data/Procfile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# This is an empty file, to silence an buildpack warning during testing.
|
data/README.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# Satorix::Common
|
2
|
+
|
3
|
+
By [Internet Exposure](https://www.iexposure.com/)
|
4
|
+
|
5
|
+
[![build](http://gitlab.iexposure.com/satorix/satorix-commmon/badges/master/build.svg)](http://gitlab.iexposure.com/satorix/satorix-commmon/pipelines)
|
6
|
+
[![coverage](http://gitlab.iexposure.com/satorix/satorix-commmon/badges/master/coverage.svg)](http://gitlab.iexposure.com/satorix/satorix-commmon/pipelines)
|
7
|
+
|
8
|
+
|
9
|
+
This gem contains code shared between two or more separate Satorix applications.
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Add this line to your application's Gemfile:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
gem 'satorix-common'
|
17
|
+
```
|
18
|
+
|
19
|
+
And then execute:
|
20
|
+
|
21
|
+
$ bundle
|
22
|
+
|
23
|
+
Or install it yourself as:
|
24
|
+
|
25
|
+
$ gem install satorix-common
|
26
|
+
|
27
|
+
## Usage
|
28
|
+
|
29
|
+
Include the gem in a relevant project to access shared logic.
|
30
|
+
|
31
|
+
## Development
|
32
|
+
|
33
|
+
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.
|
34
|
+
|
35
|
+
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).
|
36
|
+
|
37
|
+
## CI/CD
|
38
|
+
|
39
|
+
Satorix is used to provide continuous integration and continuous deployment for this application.
|
40
|
+
|
41
|
+
CI is run against every push.
|
42
|
+
|
43
|
+
CD is used to automatically build and deploy the gem for the master branch.
|
44
|
+
To initiate the deploy, first ensure you have advanced the version number appropriately. Then, create a new version tag
|
45
|
+
on the master branch. The tag should follow the format of v# (If we were releasing version 1.0.3, the tag should be v1.0.3).
|
46
|
+
|
47
|
+
|
48
|
+
## Contributing
|
49
|
+
|
50
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/satorix-common.
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "satorix/common"
|
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,180 @@
|
|
1
|
+
module Satorix
|
2
|
+
module Common
|
3
|
+
module Console
|
4
|
+
|
5
|
+
require 'benchmark'
|
6
|
+
require 'English' # http://ruby-doc.org/stdlib-2.0.0/libdoc/English/rdoc/English.html
|
7
|
+
require 'shellwords'
|
8
|
+
|
9
|
+
extend self
|
10
|
+
|
11
|
+
|
12
|
+
def colorize(text, color = nil)
|
13
|
+
"\033[#{ colors[color] }m#{ text }\033[0m"
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
def colors
|
18
|
+
Hash.new(39).merge(red: '0;31', light_red: '1;31',
|
19
|
+
green: '0;32', light_green: '1;32',
|
20
|
+
yellow: '0;33', light_yellow: '1;33',
|
21
|
+
blue: '0;34', light_blue: '1;34',
|
22
|
+
magenta: '0;35', light_magenta: '1;35',
|
23
|
+
cyan: '0;36', light_cyan: '1;36',
|
24
|
+
white: '0;37', light_white: '1;37')
|
25
|
+
end
|
26
|
+
|
27
|
+
|
28
|
+
def humanize_time(seconds)
|
29
|
+
return 'less than 1 second' if seconds < 1
|
30
|
+
[[60, :second], [60, :minute], [24, :hour], [1000, :day]].map do |count, name|
|
31
|
+
if seconds > 0
|
32
|
+
seconds, n = seconds.divmod(count)
|
33
|
+
n = n.to_i
|
34
|
+
"#{ n } #{ name }#{ 's' if n > 1 }" if n > 0
|
35
|
+
end
|
36
|
+
end.compact.reverse.join(' ')
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
def log(text, color = nil)
|
41
|
+
puts color ? colorize(text, color) : text
|
42
|
+
end
|
43
|
+
|
44
|
+
|
45
|
+
def log_command(text)
|
46
|
+
log text, :cyan
|
47
|
+
end
|
48
|
+
|
49
|
+
|
50
|
+
def log_duration(text)
|
51
|
+
log text, :light_cyan
|
52
|
+
end
|
53
|
+
|
54
|
+
|
55
|
+
def log_header(text)
|
56
|
+
log("\n#{ text }", :light_green)
|
57
|
+
end
|
58
|
+
|
59
|
+
|
60
|
+
def log_error(text)
|
61
|
+
log text, :light_red
|
62
|
+
end
|
63
|
+
|
64
|
+
|
65
|
+
def log_error_and_abort(text)
|
66
|
+
log_error text
|
67
|
+
abort text
|
68
|
+
end
|
69
|
+
|
70
|
+
|
71
|
+
def log_bench(message)
|
72
|
+
log_header message
|
73
|
+
result = nil
|
74
|
+
log_duration "Time elapsed: #{ humanize_time Benchmark.realtime { result = yield } }."
|
75
|
+
result
|
76
|
+
end
|
77
|
+
|
78
|
+
|
79
|
+
# The preferred way to use this method is by passing an array containing the command.
|
80
|
+
# This will ensure that items are properly escaped.
|
81
|
+
# It is also possible to use nested arrays. See tests for example use cases.
|
82
|
+
#
|
83
|
+
# If you want to see how your string command translates into an arry, you can use shellsplit method.
|
84
|
+
#
|
85
|
+
# For example:
|
86
|
+
# 'ruby -v'.shellsplit
|
87
|
+
# => ["ruby", "-v"]
|
88
|
+
#
|
89
|
+
# If, for some reason, you need to supply a string that is already escaped or should not be escaped, it is
|
90
|
+
# possible to supply a string argument instead of an array. If you do this, you will need to supply
|
91
|
+
# an additional parameter of string_verified_safe, to ensure that the operation is deliberate.
|
92
|
+
def run_command(command, filtered_text: [], quiet: false, string_verified_safe: false)
|
93
|
+
# This method is used *EVERYWHERE*.
|
94
|
+
# Seemingly small changes can have far-ranging and extreme consequences.
|
95
|
+
# Modify only with extreme caution.
|
96
|
+
#
|
97
|
+
# Note: Many applications (like echo and the Flynn CLI) append a newline to their output.
|
98
|
+
# If you are using the command result, it may be desirable to chomp the trailing
|
99
|
+
# newline. It is left to the implementing call to handle this, as it proved
|
100
|
+
# cumbersome to handle in this method in a way that worked perfectly in all cases.
|
101
|
+
raise('Potentially unsafe or problematic command. Please refer to the method documentation for more information.') if command.is_a?(String) && !string_verified_safe
|
102
|
+
|
103
|
+
command = normalized_command(command)
|
104
|
+
logged_command = logged_command(command, filtered_text)
|
105
|
+
log_command(logged_command) unless quiet
|
106
|
+
|
107
|
+
''.tap do |output|
|
108
|
+
IO.popen(bash(command)) do |io|
|
109
|
+
until io.eof?
|
110
|
+
line = io.gets
|
111
|
+
puts line unless quiet || line.empty?
|
112
|
+
$stdout.flush
|
113
|
+
output.concat line
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
handle_run_command_error(logged_command, quiet) unless $CHILD_STATUS.success?
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
|
122
|
+
# http://stackoverflow.com/questions/1197224/source-shell-script-into-environment-within-a-ruby-script
|
123
|
+
# TODO : reduce / consolidate?
|
124
|
+
# Find variables changed as a result of sourcing the given file, and update in ENV.
|
125
|
+
def source_env_from(file)
|
126
|
+
bash_source(file).each { |k, v| ENV[k] = v }
|
127
|
+
end
|
128
|
+
|
129
|
+
|
130
|
+
private
|
131
|
+
|
132
|
+
|
133
|
+
def bash(command)
|
134
|
+
['bash -c', escaped_command(command), '2>&1'].join(' ')
|
135
|
+
end
|
136
|
+
|
137
|
+
|
138
|
+
def logged_command(command, filtered_text)
|
139
|
+
filtered_text = [filtered_text].flatten.delete_if { |text| text.nil? || text.strip.empty? }
|
140
|
+
unescaped_command = command.shellsplit.join(' ')
|
141
|
+
unescaped_command.gsub(Regexp.union(filtered_text.sort_by(&:length).reverse), '[MASKED]')
|
142
|
+
end
|
143
|
+
|
144
|
+
|
145
|
+
def escaped_command(command)
|
146
|
+
command.shellescape
|
147
|
+
end
|
148
|
+
|
149
|
+
|
150
|
+
def normalized_command(command)
|
151
|
+
command.is_a?(Array) ? command.flatten.shelljoin : command
|
152
|
+
end
|
153
|
+
|
154
|
+
|
155
|
+
def handle_run_command_error(logged_command, quiet)
|
156
|
+
error_message = "\nAn error has occurred while running the following command:\n#{ logged_command }\n"
|
157
|
+
quiet ? abort : log_error_and_abort(error_message)
|
158
|
+
end
|
159
|
+
|
160
|
+
|
161
|
+
# http://stackoverflow.com/questions/1197224/source-shell-script-into-environment-within-a-ruby-script
|
162
|
+
# TODO : reduce / consolidate?
|
163
|
+
# Read in the bash environment, after an optional command. Returns Array of key/value pairs.
|
164
|
+
def bash_env(cmd = nil)
|
165
|
+
env_cmd = bash("#{ cmd + ';' if cmd } printenv")
|
166
|
+
env = `#{ env_cmd }`
|
167
|
+
env.split(/\n/).map { |l| l.split(/=/, 2) }
|
168
|
+
end
|
169
|
+
|
170
|
+
|
171
|
+
# http://stackoverflow.com/questions/1197224/source-shell-script-into-environment-within-a-ruby-script
|
172
|
+
# TODO : reduce / consolidate?
|
173
|
+
# Source a given file, and compare environment before and after. Returns Hash of any keys that have changed.
|
174
|
+
def bash_source(file)
|
175
|
+
Hash[bash_env("source #{ File.realpath file }") - bash_env]
|
176
|
+
end
|
177
|
+
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|
@@ -0,0 +1,149 @@
|
|
1
|
+
module Satorix
|
2
|
+
module Common
|
3
|
+
module Pricing
|
4
|
+
|
5
|
+
class MissingApplicationConfigurationSettings < StandardError
|
6
|
+
end
|
7
|
+
|
8
|
+
class MissingPricingConfigurationElement < StandardError
|
9
|
+
end
|
10
|
+
|
11
|
+
class InvalidNegativeTotalPrice < StandardError
|
12
|
+
end
|
13
|
+
|
14
|
+
|
15
|
+
class << self
|
16
|
+
|
17
|
+
|
18
|
+
def package_defaults(package)
|
19
|
+
default_defaults.merge overrides_for(package)
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
def packages
|
24
|
+
overrides.keys
|
25
|
+
end
|
26
|
+
|
27
|
+
|
28
|
+
def pricing
|
29
|
+
# Different Rails versions use different types for keys.
|
30
|
+
pricing = ::Rails.application.secrets.satorix['pricing_in_cents'] ||
|
31
|
+
::Rails.application.secrets.satorix[:pricing_in_cents]
|
32
|
+
|
33
|
+
raise(MissingApplicationConfigurationSettings, 'No pricing information configured.') if pricing.nil? || pricing.empty?
|
34
|
+
|
35
|
+
pricing = Hash[pricing.map { |key, value| [key.to_sym, value] }]
|
36
|
+
|
37
|
+
pricing
|
38
|
+
end
|
39
|
+
|
40
|
+
|
41
|
+
def pricing_for(attribute)
|
42
|
+
price = pricing[secrets_key_for_attribute(attribute)]
|
43
|
+
|
44
|
+
raise(MissingApplicationConfigurationSettings, "No pricing information configured for the '#{ attribute }' atttribute.") if price.nil?
|
45
|
+
|
46
|
+
price
|
47
|
+
end
|
48
|
+
|
49
|
+
|
50
|
+
def starting_price_for(package)
|
51
|
+
settings = package_defaults(package)
|
52
|
+
total_price settings
|
53
|
+
end
|
54
|
+
|
55
|
+
|
56
|
+
def secrets_key_for_attribute(attribute)
|
57
|
+
{
|
58
|
+
base_cost: :base_cost,
|
59
|
+
runners: :per_runner,
|
60
|
+
gitlab_storage: :per_gb_of_gitlab_storage,
|
61
|
+
staging_hosts: :per_staging_cluster_host,
|
62
|
+
staging_storage: :per_staging_gb_of_storage_per_host,
|
63
|
+
production_hosts: :per_production_cluster_host,
|
64
|
+
production_storage: :per_production_gb_of_storage_per_host,
|
65
|
+
premium_support: :support_package_premium,
|
66
|
+
free_support: :support_package_free
|
67
|
+
}[attribute]
|
68
|
+
end
|
69
|
+
|
70
|
+
|
71
|
+
def total_price(configuration)
|
72
|
+
raise(MissingPricingConfigurationElement) if configuration.keys.to_set != default_defaults.keys.to_set
|
73
|
+
|
74
|
+
cost = pricing[:base_cost]
|
75
|
+
configuration.each do |attribute, quantity|
|
76
|
+
price = pricing[secrets_key_for_attribute(attribute)]
|
77
|
+
cost += price * quantity * scaling_modifier(attribute, configuration)
|
78
|
+
end
|
79
|
+
|
80
|
+
raise(InvalidNegativeTotalPrice) if cost.negative?
|
81
|
+
|
82
|
+
cost
|
83
|
+
end
|
84
|
+
|
85
|
+
|
86
|
+
def scaling_modifier(attribute, configuration)
|
87
|
+
modifying_attribute = scaled_attributes[attribute]
|
88
|
+
modifying_attribute ? configuration[modifying_attribute] : 1
|
89
|
+
end
|
90
|
+
|
91
|
+
|
92
|
+
def scaled_attributes
|
93
|
+
# The key is the scaled attribute, the value is the attribute that modfies the scaled attribute.
|
94
|
+
{ staging_storage: :staging_hosts,
|
95
|
+
production_storage: :production_hosts }
|
96
|
+
end
|
97
|
+
|
98
|
+
|
99
|
+
private
|
100
|
+
|
101
|
+
|
102
|
+
def overrides
|
103
|
+
{ 'starter' => starter_defaults,
|
104
|
+
'cluster' => cluster_defaults,
|
105
|
+
'custom' => custom_defaults }
|
106
|
+
end
|
107
|
+
|
108
|
+
|
109
|
+
def overrides_for(package)
|
110
|
+
overrides[package] || starter_defaults # default to starter options, for invalid selections
|
111
|
+
end
|
112
|
+
|
113
|
+
|
114
|
+
def default_defaults
|
115
|
+
{ runners: 1,
|
116
|
+
gitlab_storage: 100,
|
117
|
+
staging_hosts: 1,
|
118
|
+
staging_storage: 50,
|
119
|
+
production_hosts: 3,
|
120
|
+
production_storage: 100,
|
121
|
+
free_support: 1,
|
122
|
+
premium_support: 0 }
|
123
|
+
end
|
124
|
+
|
125
|
+
|
126
|
+
def starter_defaults
|
127
|
+
{ production_hosts: 1 }
|
128
|
+
end
|
129
|
+
|
130
|
+
|
131
|
+
def cluster_defaults
|
132
|
+
{ runners: 2,
|
133
|
+
free_support: 0,
|
134
|
+
premium_support: 1 }
|
135
|
+
end
|
136
|
+
|
137
|
+
|
138
|
+
def custom_defaults
|
139
|
+
{ free_support: 0,
|
140
|
+
premium_support: 1 }
|
141
|
+
end
|
142
|
+
|
143
|
+
|
144
|
+
end
|
145
|
+
|
146
|
+
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
module Satorix
|
2
|
+
module CI
|
3
|
+
module Deploy
|
4
|
+
module Rubygems
|
5
|
+
|
6
|
+
require 'fileutils'
|
7
|
+
|
8
|
+
include Satorix::Shared::Console
|
9
|
+
|
10
|
+
extend self
|
11
|
+
|
12
|
+
|
13
|
+
def go
|
14
|
+
log_bench('Generating rubygems.org configuration_file...') { generate_rubygems_configuration_file }
|
15
|
+
log_bench('Preparing gem build directory...') { prepare_gem_build_directory }
|
16
|
+
log_bench('Building gem...') { build_gem }
|
17
|
+
built_gems.each { |gem| log_bench("Publishing #{ File.basename gem }...") { publish_gem gem } }
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
|
24
|
+
def build_gem
|
25
|
+
Dir.chdir(Satorix.app_dir) do
|
26
|
+
run_command(%w[bundle exec rake build])
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
|
31
|
+
def built_gems
|
32
|
+
Dir.glob(File.join(gem_build_directory, '*.gem')).select { |e| File.file? e }
|
33
|
+
end
|
34
|
+
|
35
|
+
|
36
|
+
def gem_build_directory
|
37
|
+
File.join(Satorix.app_dir, 'pkg')
|
38
|
+
end
|
39
|
+
|
40
|
+
|
41
|
+
def generate_rubygems_configuration_file
|
42
|
+
path = File.join(Dir.home, '.gem')
|
43
|
+
FileUtils.mkdir_p(path) unless File.exist?(path)
|
44
|
+
|
45
|
+
file = File.join(path, 'credentials')
|
46
|
+
File.open(file, 'w') { |f| f.write rubygems_configuration_file_contents }
|
47
|
+
FileUtils.chmod 0600, file
|
48
|
+
end
|
49
|
+
|
50
|
+
|
51
|
+
def prepare_gem_build_directory
|
52
|
+
run_command(['rm', '-rf', gem_build_directory])
|
53
|
+
FileUtils.mkdir_p gem_build_directory
|
54
|
+
end
|
55
|
+
|
56
|
+
|
57
|
+
def publish_gem(gem)
|
58
|
+
run_command(['gem', 'push', gem, '--config-file', File.join(Dir.home, '.gem', 'credentials')])
|
59
|
+
rescue RuntimeError
|
60
|
+
# To prevent the display of an ugly stacktrace.
|
61
|
+
abort "\nGem was not published!"
|
62
|
+
end
|
63
|
+
|
64
|
+
|
65
|
+
def rubygems_api_key
|
66
|
+
ENV['SATORIX_CI_RUBYGEMS_API_KEY']
|
67
|
+
end
|
68
|
+
|
69
|
+
|
70
|
+
def rubygems_configuration_file_contents
|
71
|
+
"---\n:rubygems_api_key: #{ rubygems_api_key }"
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
data/satorix/custom.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
lib = File.expand_path("../lib", __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require "satorix/common/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "satorix-common"
|
7
|
+
spec.version = Satorix::Common::VERSION
|
8
|
+
spec.authors = ['Internet Exposure']
|
9
|
+
spec.email = ['info@iexposure.com']
|
10
|
+
|
11
|
+
spec.summary = %q{Common library for Satorix}
|
12
|
+
spec.description = %q{This gem contains code shared between two or more separate Satorix applications.}
|
13
|
+
spec.homepage = "http://gitlab.iexposure.com/satorix/satorix-common"
|
14
|
+
|
15
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
16
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
17
|
+
if spec.respond_to?(:metadata)
|
18
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
19
|
+
|
20
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
21
|
+
# spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
|
22
|
+
# spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
|
23
|
+
else
|
24
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
25
|
+
"public gem pushes."
|
26
|
+
end
|
27
|
+
|
28
|
+
# Specify which files should be added to the gem when it is released.
|
29
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
30
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
31
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
32
|
+
end
|
33
|
+
spec.bindir = "exe"
|
34
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
35
|
+
spec.require_paths = ["lib"]
|
36
|
+
|
37
|
+
spec.add_dependency 'rake'
|
38
|
+
|
39
|
+
end
|
40
|
+
|
metadata
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: satorix-common
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.5
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Internet Exposure
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-11-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description: This gem contains code shared between two or more separate Satorix applications.
|
28
|
+
email:
|
29
|
+
- info@iexposure.com
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- ".gitignore"
|
35
|
+
- ".gitlab-ci.yml"
|
36
|
+
- ".rspec"
|
37
|
+
- ".ruby-version"
|
38
|
+
- Gemfile
|
39
|
+
- Gemfile.lock
|
40
|
+
- Procfile
|
41
|
+
- README.md
|
42
|
+
- Rakefile
|
43
|
+
- bin/console
|
44
|
+
- bin/setup
|
45
|
+
- lib/satorix/common.rb
|
46
|
+
- lib/satorix/common/console.rb
|
47
|
+
- lib/satorix/common/pricing.rb
|
48
|
+
- lib/satorix/common/version.rb
|
49
|
+
- satorix-common.gemspec
|
50
|
+
- satorix/CI/deploy/rubygems.rb
|
51
|
+
- satorix/custom.rb
|
52
|
+
homepage: http://gitlab.iexposure.com/satorix/satorix-common
|
53
|
+
licenses: []
|
54
|
+
metadata:
|
55
|
+
allowed_push_host: https://rubygems.org
|
56
|
+
homepage_uri: http://gitlab.iexposure.com/satorix/satorix-common
|
57
|
+
post_install_message:
|
58
|
+
rdoc_options: []
|
59
|
+
require_paths:
|
60
|
+
- lib
|
61
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
requirements: []
|
72
|
+
rubygems_version: 3.0.3
|
73
|
+
signing_key:
|
74
|
+
specification_version: 4
|
75
|
+
summary: Common library for Satorix
|
76
|
+
test_files: []
|