killbill-kpm 0.3.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +33 -0
  3. data/.travis.yml +41 -0
  4. data/Gemfile +5 -0
  5. data/Gemfile.head +5 -0
  6. data/Gemfile.lock +109 -0
  7. data/Jarfile +12 -0
  8. data/Jarfile.lock +64 -0
  9. data/LICENSE +201 -0
  10. data/README.md +58 -15
  11. data/Rakefile +19 -34
  12. data/VERSION +1 -0
  13. data/config.ru +4 -0
  14. data/killbill-kpm.gemspec +31 -0
  15. data/killbill.properties +3 -0
  16. data/lib/kpm/application.rb +92 -0
  17. data/lib/kpm/listener.rb +95 -0
  18. data/lib/kpm/plugins_installer.rb +112 -0
  19. data/lib/kpm_plugin.rb +13 -0
  20. data/pom.xml +44 -0
  21. data/release.sh +61 -0
  22. data/spec/kpm/base_plugin_spec.rb +25 -0
  23. data/spec/spec_helper.rb +14 -0
  24. metadata +66 -190
  25. data/MIT-LICENSE +0 -20
  26. data/app/assets/javascripts/application.js +0 -18
  27. data/app/assets/javascripts/kpm/kpm.js +0 -7
  28. data/app/assets/stylesheets/application.css +0 -19
  29. data/app/assets/stylesheets/bootstrap_and_overrides.css +0 -13
  30. data/app/assets/stylesheets/kpm/kpm.css +0 -6
  31. data/app/controllers/kpm/engine_controller.rb +0 -29
  32. data/app/controllers/kpm/nodes_info_controller.rb +0 -109
  33. data/app/controllers/kpm/plugins_controller.rb +0 -19
  34. data/app/helpers/kpm/application_helper.rb +0 -4
  35. data/app/views/kpm/layouts/kpm_application.html.erb +0 -31
  36. data/app/views/kpm/nodes_info/_logs_table.html.erb +0 -43
  37. data/app/views/kpm/nodes_info/_nodes_table.html.erb +0 -68
  38. data/app/views/kpm/nodes_info/index.html.erb +0 -68
  39. data/app/views/kpm/nodes_info/index.js.erb +0 -4
  40. data/app/views/kpm/plugins/_form.html.erb +0 -37
  41. data/app/views/kpm/plugins/_plugins_table.html.erb +0 -48
  42. data/app/views/kpm/plugins/index.html.erb +0 -18
  43. data/config/routes.rb +0 -17
  44. data/lib/kpm/client.rb +0 -31
  45. data/lib/kpm/engine.rb +0 -21
  46. data/lib/kpm/version.rb +0 -3
  47. data/lib/kpm.rb +0 -24
  48. data/lib/tasks/kpm_tasks.rake +0 -4
  49. data/test/dummy/README.rdoc +0 -28
  50. data/test/dummy/Rakefile +0 -6
  51. data/test/dummy/app/controllers/application_controller.rb +0 -5
  52. data/test/dummy/app/helpers/application_helper.rb +0 -2
  53. data/test/dummy/bin/bundle +0 -3
  54. data/test/dummy/bin/rails +0 -4
  55. data/test/dummy/bin/rake +0 -4
  56. data/test/dummy/bin/setup +0 -38
  57. data/test/dummy/bin/update +0 -29
  58. data/test/dummy/bin/yarn +0 -11
  59. data/test/dummy/config/application.rb +0 -26
  60. data/test/dummy/config/boot.rb +0 -3
  61. data/test/dummy/config/environment.rb +0 -5
  62. data/test/dummy/config/environments/development.rb +0 -54
  63. data/test/dummy/config/environments/production.rb +0 -91
  64. data/test/dummy/config/environments/test.rb +0 -42
  65. data/test/dummy/config/initializers/application_controller_renderer.rb +0 -6
  66. data/test/dummy/config/initializers/assets.rb +0 -14
  67. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  68. data/test/dummy/config/initializers/cookies_serializer.rb +0 -5
  69. data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  70. data/test/dummy/config/initializers/inflections.rb +0 -16
  71. data/test/dummy/config/initializers/killbill_client.rb +0 -3
  72. data/test/dummy/config/initializers/mime_types.rb +0 -4
  73. data/test/dummy/config/initializers/new_framework_defaults_5_1.rb +0 -14
  74. data/test/dummy/config/initializers/session_store.rb +0 -3
  75. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  76. data/test/dummy/config/locales/en.yml +0 -33
  77. data/test/dummy/config/routes.rb +0 -4
  78. data/test/dummy/config/secrets.yml +0 -32
  79. data/test/dummy/config.ru +0 -4
  80. data/test/integration/navigation_test.rb +0 -17
  81. data/test/kpm_test.rb +0 -8
  82. data/test/test_helper.rb +0 -19
data/lib/kpm_plugin.rb ADDED
@@ -0,0 +1,13 @@
1
+ require 'active_support/core_ext/object/blank'
2
+ require 'json'
3
+ require 'pathname'
4
+ require 'sinatra'
5
+ require 'yaml'
6
+
7
+ require 'kpm'
8
+
9
+ require 'killbill'
10
+ require 'killbill/helpers/active_merchant/properties'
11
+
12
+ require 'kpm/plugins_installer'
13
+ require 'kpm/listener'
data/pom.xml ADDED
@@ -0,0 +1,44 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ ~ Copyright 2014-2015 The Billing Project, LLC
4
+ ~
5
+ ~ The Billing Project licenses this file to you under the Apache License, version 2.0
6
+ ~ (the "License"); you may not use this file except in compliance with the
7
+ ~ License. You may obtain a copy of the License at:
8
+ ~
9
+ ~ http://www.apache.org/licenses/LICENSE-2.0
10
+ ~
11
+ ~ Unless required by applicable law or agreed to in writing, software
12
+ ~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ ~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ ~ License for the specific language governing permissions and limitations
15
+ ~ under the License.
16
+ -->
17
+
18
+ <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">
19
+ <parent>
20
+ <groupId>org.sonatype.oss</groupId>
21
+ <artifactId>oss-parent</artifactId>
22
+ <version>5</version>
23
+ </parent>
24
+ <modelVersion>4.0.0</modelVersion>
25
+ <groupId>org.kill-bill.billing.plugin.ruby</groupId>
26
+ <artifactId>kpm-plugin</artifactId>
27
+ <packaging>pom</packaging>
28
+ <version>1.0.0</version>
29
+ <name>kpm-plugin</name>
30
+ <url>http://github.com/killbill/killbill-kpm-plugin</url>
31
+ <description>Kill Bill KPM plugin</description>
32
+ <licenses>
33
+ <license>
34
+ <name>Apache License 2.0</name>
35
+ <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
36
+ <distribution>repo</distribution>
37
+ </license>
38
+ </licenses>
39
+ <scm>
40
+ <connection>scm:git:git://github.com/killbill/killbill-kpm-plugin.git</connection>
41
+ <url>https://github.com/killbill/killbill-kpm-plugin/</url>
42
+ <developerConnection>scm:git:git@github.com:killbill/killbill-kpm-plugin.git</developerConnection>
43
+ </scm>
44
+ </project>
data/release.sh ADDED
@@ -0,0 +1,61 @@
1
+ set -e
2
+
3
+ BUNDLE=${BUNDLE-"bundle exec"}
4
+ MVN=${MVN-"mvn"}
5
+
6
+ if [ 'GNU' != "$(tar --help | grep GNU | head -1 | awk '{print $1}')" ]; then
7
+ echo 'Unable to release: make sure to use GNU tar'
8
+ exit 1
9
+ fi
10
+
11
+ if $(ruby -e'require "java"'); then
12
+ # Good
13
+ echo 'Detected JRuby'
14
+ else
15
+ echo 'Unable to release: make sure to use JRuby'
16
+ exit 1
17
+ fi
18
+
19
+ VERSION=`grep -E '<version>([0-9]+\.[0-9]+\.[0-9]+)</version>' pom.xml | sed 's/[\t \n]*<version>\(.*\)<\/version>[\t \n]*/\1/'`
20
+ if [[ -z "$NO_RELEASE" && "$VERSION" != "$(cat $PWD/VERSION)" ]]; then
21
+ echo 'Unable to release: make sure the versions in pom.xml and VERSION match'
22
+ exit 1
23
+ fi
24
+
25
+ echo 'Cleaning up'
26
+ $BUNDLE rake killbill:clean
27
+
28
+ echo 'Building gem'
29
+ $BUNDLE rake build
30
+
31
+ if [[ -z "$NO_RELEASE" ]]; then
32
+ echo 'Pushing the gem to Rubygems'
33
+ $BUNDLE rake release
34
+ fi
35
+
36
+ echo 'Building artifact'
37
+ $BUNDLE rake killbill:package
38
+
39
+ ARTIFACT="$PWD/pkg/killbill-kpm-$VERSION.tar.gz"
40
+ echo "Pushing $ARTIFACT to Maven Central"
41
+
42
+ if [[ -z "$NO_RELEASE" ]]; then
43
+ GOAL=gpg:sign-and-deploy-file
44
+ REPOSITORY_ID=ossrh-releases
45
+ URL=https://oss.sonatype.org/service/local/staging/deploy/maven2/
46
+ else
47
+ GOAL=deploy:deploy-file
48
+ REPOSITORY_ID=sonatype-nexus-snapshots
49
+ URL=https://oss.sonatype.org/content/repositories/snapshots/
50
+ VERSION="$VERSION-SNAPSHOT"
51
+ fi
52
+
53
+ $MVN $GOAL \
54
+ -DgroupId=org.kill-bill.billing.plugin.ruby \
55
+ -DartifactId=kpm-plugin \
56
+ -Dversion=$VERSION \
57
+ -Dpackaging=tar.gz \
58
+ -DrepositoryId=$REPOSITORY_ID \
59
+ -Durl=$URL \
60
+ -Dfile=$ARTIFACT \
61
+ -DpomFile=pom.xml
@@ -0,0 +1,25 @@
1
+ require 'spec_helper'
2
+
3
+ describe ::KPM::Listener do
4
+
5
+ include ::Killbill::Plugin::ActiveMerchant::RSpec
6
+
7
+ before(:each) do
8
+ Dir.mktmpdir do |dir|
9
+ file = File.new(File.join(dir, 'kpm.yml'), 'w+')
10
+ file.write(<<-eos)
11
+ :kpm:
12
+ eos
13
+ file.close
14
+
15
+ @plugin = build_plugin(::KPM::Listener, 'kpm', File.dirname(file))
16
+
17
+ # Start the plugin here - since the config file will be deleted
18
+ @plugin.start_plugin
19
+ end
20
+ end
21
+
22
+ it 'should start and stop correctly' do
23
+ @plugin.stop_plugin
24
+ end
25
+ end
@@ -0,0 +1,14 @@
1
+ require 'bundler'
2
+ require 'kpm_plugin'
3
+ require 'killbill/helpers/properties_helper'
4
+ require 'killbill/helpers/active_merchant/killbill_spec_helper'
5
+
6
+ require 'logger'
7
+
8
+ require 'rspec'
9
+
10
+ RSpec.configure do |config|
11
+ config.color_enabled = true
12
+ config.tty = true
13
+ config.formatter = 'documentation'
14
+ end
metadata CHANGED
@@ -1,263 +1,139 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: killbill-kpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
- - Kill Bill core team
8
- autorequire:
7
+ - Killbill core team
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-22 00:00:00.000000000 Z
11
+ date: 2016-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rails
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
- - - "~>"
16
+ - - ~>
18
17
  - !ruby/object:Gem::Version
19
- version: '5.1'
20
- type: :runtime
18
+ version: 8.0.1
19
+ name: killbill
21
20
  prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '5.1'
27
- - !ruby/object:Gem::Dependency
28
- name: jquery-rails
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '4.3'
34
21
  type: :runtime
35
- prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
- - - "~>"
24
+ - - ~>
39
25
  - !ruby/object:Gem::Version
40
- version: '4.3'
26
+ version: 8.0.1
41
27
  - !ruby/object:Gem::Dependency
42
- name: jquery-datatables-rails
43
28
  requirement: !ruby/object:Gem::Requirement
44
29
  requirements:
45
- - - "~>"
30
+ - - ~>
46
31
  - !ruby/object:Gem::Version
47
- version: '3.3'
48
- type: :runtime
32
+ version: 0.1.4
33
+ name: kpm
49
34
  prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '3.3'
55
- - !ruby/object:Gem::Dependency
56
- name: twitter-bootstrap-rails
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
35
  type: :runtime
63
- prerelease: false
64
36
  version_requirements: !ruby/object:Gem::Requirement
65
37
  requirements:
66
- - - ">="
38
+ - - ~>
67
39
  - !ruby/object:Gem::Version
68
- version: '0'
40
+ version: 0.1.4
69
41
  - !ruby/object:Gem::Dependency
70
- name: font-awesome-rails
71
42
  requirement: !ruby/object:Gem::Requirement
72
43
  requirements:
73
- - - "~>"
44
+ - - ~>
74
45
  - !ruby/object:Gem::Version
75
- version: '4.7'
76
- type: :runtime
46
+ version: 0.9.2
47
+ name: jbundler
77
48
  prerelease: false
49
+ type: :development
78
50
  version_requirements: !ruby/object:Gem::Requirement
79
51
  requirements:
80
- - - "~>"
52
+ - - ~>
81
53
  - !ruby/object:Gem::Version
82
- version: '4.7'
54
+ version: 0.9.2
83
55
  - !ruby/object:Gem::Dependency
84
- name: killbill-client
85
56
  requirement: !ruby/object:Gem::Requirement
86
57
  requirements:
87
- - - "~>"
58
+ - - '>='
88
59
  - !ruby/object:Gem::Version
89
- version: '1.0'
90
- type: :runtime
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '1.0'
97
- - !ruby/object:Gem::Dependency
60
+ version: 10.0.0
98
61
  name: rake
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
62
  prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: simplecov
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
63
  type: :development
119
- prerelease: false
120
64
  version_requirements: !ruby/object:Gem::Requirement
121
65
  requirements:
122
- - - ">="
66
+ - - '>='
123
67
  - !ruby/object:Gem::Version
124
- version: '0'
68
+ version: 10.0.0
125
69
  - !ruby/object:Gem::Dependency
126
- name: listen
127
70
  requirement: !ruby/object:Gem::Requirement
128
71
  requirements:
129
- - - ">="
72
+ - - ~>
130
73
  - !ruby/object:Gem::Version
131
- version: '0'
132
- type: :development
74
+ version: 2.12.0
75
+ name: rspec
133
76
  prerelease: false
77
+ type: :development
134
78
  version_requirements: !ruby/object:Gem::Requirement
135
79
  requirements:
136
- - - ">="
80
+ - - ~>
137
81
  - !ruby/object:Gem::Version
138
- version: '0'
139
- description: Rails UI plugin for the KPM plugin.
82
+ version: 2.12.0
83
+ description: Plugin to manage installed plugins
140
84
  email: killbilling-users@googlegroups.com
141
85
  executables: []
142
86
  extensions: []
143
87
  extra_rdoc_files: []
144
88
  files:
145
- - MIT-LICENSE
89
+ - .gitignore
90
+ - .travis.yml
91
+ - Gemfile
92
+ - Gemfile.head
93
+ - Gemfile.lock
94
+ - Jarfile
95
+ - Jarfile.lock
96
+ - LICENSE
146
97
  - README.md
147
98
  - Rakefile
148
- - app/assets/javascripts/application.js
149
- - app/assets/javascripts/kpm/kpm.js
150
- - app/assets/stylesheets/application.css
151
- - app/assets/stylesheets/bootstrap_and_overrides.css
152
- - app/assets/stylesheets/kpm/kpm.css
153
- - app/controllers/kpm/engine_controller.rb
154
- - app/controllers/kpm/nodes_info_controller.rb
155
- - app/controllers/kpm/plugins_controller.rb
156
- - app/helpers/kpm/application_helper.rb
157
- - app/views/kpm/layouts/kpm_application.html.erb
158
- - app/views/kpm/nodes_info/_logs_table.html.erb
159
- - app/views/kpm/nodes_info/_nodes_table.html.erb
160
- - app/views/kpm/nodes_info/index.html.erb
161
- - app/views/kpm/nodes_info/index.js.erb
162
- - app/views/kpm/plugins/_form.html.erb
163
- - app/views/kpm/plugins/_plugins_table.html.erb
164
- - app/views/kpm/plugins/index.html.erb
165
- - config/routes.rb
166
- - lib/kpm.rb
167
- - lib/kpm/client.rb
168
- - lib/kpm/engine.rb
169
- - lib/kpm/version.rb
170
- - lib/tasks/kpm_tasks.rake
171
- - test/dummy/README.rdoc
172
- - test/dummy/Rakefile
173
- - test/dummy/app/controllers/application_controller.rb
174
- - test/dummy/app/helpers/application_helper.rb
175
- - test/dummy/bin/bundle
176
- - test/dummy/bin/rails
177
- - test/dummy/bin/rake
178
- - test/dummy/bin/setup
179
- - test/dummy/bin/update
180
- - test/dummy/bin/yarn
181
- - test/dummy/config.ru
182
- - test/dummy/config/application.rb
183
- - test/dummy/config/boot.rb
184
- - test/dummy/config/environment.rb
185
- - test/dummy/config/environments/development.rb
186
- - test/dummy/config/environments/production.rb
187
- - test/dummy/config/environments/test.rb
188
- - test/dummy/config/initializers/application_controller_renderer.rb
189
- - test/dummy/config/initializers/assets.rb
190
- - test/dummy/config/initializers/backtrace_silencers.rb
191
- - test/dummy/config/initializers/cookies_serializer.rb
192
- - test/dummy/config/initializers/filter_parameter_logging.rb
193
- - test/dummy/config/initializers/inflections.rb
194
- - test/dummy/config/initializers/killbill_client.rb
195
- - test/dummy/config/initializers/mime_types.rb
196
- - test/dummy/config/initializers/new_framework_defaults_5_1.rb
197
- - test/dummy/config/initializers/session_store.rb
198
- - test/dummy/config/initializers/wrap_parameters.rb
199
- - test/dummy/config/locales/en.yml
200
- - test/dummy/config/routes.rb
201
- - test/dummy/config/secrets.yml
202
- - test/integration/navigation_test.rb
203
- - test/kpm_test.rb
204
- - test/test_helper.rb
205
- homepage: http://www.killbill.io
99
+ - VERSION
100
+ - config.ru
101
+ - killbill-kpm.gemspec
102
+ - killbill.properties
103
+ - lib/kpm/application.rb
104
+ - lib/kpm/listener.rb
105
+ - lib/kpm/plugins_installer.rb
106
+ - lib/kpm_plugin.rb
107
+ - pom.xml
108
+ - release.sh
109
+ - spec/kpm/base_plugin_spec.rb
110
+ - spec/spec_helper.rb
111
+ homepage: http://killbill.io
206
112
  licenses:
207
- - MIT
113
+ - Apache License (2.0)
208
114
  metadata: {}
209
- post_install_message:
210
- rdoc_options: []
115
+ post_install_message:
116
+ rdoc_options:
117
+ - --exclude
118
+ - .
211
119
  require_paths:
212
120
  - lib
213
121
  required_ruby_version: !ruby/object:Gem::Requirement
214
122
  requirements:
215
- - - ">="
123
+ - - '>='
216
124
  - !ruby/object:Gem::Version
217
- version: '0'
125
+ version: 1.9.3
218
126
  required_rubygems_version: !ruby/object:Gem::Requirement
219
127
  requirements:
220
- - - ">="
128
+ - - '>='
221
129
  - !ruby/object:Gem::Version
222
130
  version: '0'
223
131
  requirements: []
224
- rubyforge_project:
225
- rubygems_version: 2.6.13
226
- signing_key:
132
+ rubyforge_project:
133
+ rubygems_version: 2.4.6
134
+ signing_key:
227
135
  specification_version: 4
228
- summary: Kill Bill KPM UI mountable engine
136
+ summary: Kill Bill KPM plugin
229
137
  test_files:
230
- - test/test_helper.rb
231
- - test/integration/navigation_test.rb
232
- - test/dummy/config/secrets.yml
233
- - test/dummy/config/locales/en.yml
234
- - test/dummy/config/environment.rb
235
- - test/dummy/config/routes.rb
236
- - test/dummy/config/environments/test.rb
237
- - test/dummy/config/environments/production.rb
238
- - test/dummy/config/environments/development.rb
239
- - test/dummy/config/initializers/new_framework_defaults_5_1.rb
240
- - test/dummy/config/initializers/inflections.rb
241
- - test/dummy/config/initializers/assets.rb
242
- - test/dummy/config/initializers/backtrace_silencers.rb
243
- - test/dummy/config/initializers/killbill_client.rb
244
- - test/dummy/config/initializers/filter_parameter_logging.rb
245
- - test/dummy/config/initializers/mime_types.rb
246
- - test/dummy/config/initializers/application_controller_renderer.rb
247
- - test/dummy/config/initializers/cookies_serializer.rb
248
- - test/dummy/config/initializers/session_store.rb
249
- - test/dummy/config/initializers/wrap_parameters.rb
250
- - test/dummy/config/boot.rb
251
- - test/dummy/config/application.rb
252
- - test/dummy/Rakefile
253
- - test/dummy/README.rdoc
254
- - test/dummy/app/controllers/application_controller.rb
255
- - test/dummy/app/helpers/application_helper.rb
256
- - test/dummy/config.ru
257
- - test/dummy/bin/rake
258
- - test/dummy/bin/bundle
259
- - test/dummy/bin/update
260
- - test/dummy/bin/setup
261
- - test/dummy/bin/yarn
262
- - test/dummy/bin/rails
263
- - test/kpm_test.rb
138
+ - spec/kpm/base_plugin_spec.rb
139
+ - spec/spec_helper.rb