jive_add_ons 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +4 -4
- data/app/controllers/jive_add_ons/add_ons_controller.rb +1 -0
- data/config/routes.rb +2 -2
- data/lib/jive_add_ons/concerns/controllers/add_ons.rb +13 -11
- data/lib/jive_add_ons/version.rb +1 -1
- data/lib/tasks/jive_add_ons_tasks.rake +13 -4
- metadata +1 -3
- data/README.rdoc +0 -3
- data/app/views/jive_add_ons/add_ons/create.erb +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0dd7a0583e6db12bb2036d8ed0df37ef22859fcb
|
4
|
+
data.tar.gz: 5c0b014812d86c550fb92aff6af01c1537eb28a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 269654a1c4df5ab5cc22df7c775d6dc73fcc8b5ae3741dbce9db41ccb1193f1340020dda06768c97ad695a1f76f9acd2a7dfb8d15c4d6a7af24834ffb12d3968
|
7
|
+
data.tar.gz: 9144fefd2b5e212bb916105992459f7e99b4e2248499f9b19b86ce3315e2f65e651af24ca37a976830cfe5ee9e8b8d5d111ed8c24e6f772045fd37a1cff1ed02
|
data/Rakefile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
begin
|
2
|
-
|
2
|
+
require 'bundler/setup'
|
3
3
|
rescue LoadError
|
4
|
-
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
5
|
end
|
6
6
|
|
7
7
|
require 'rdoc/task'
|
@@ -14,7 +14,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
14
14
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
15
|
end
|
16
16
|
|
17
|
-
APP_RAKEFILE = File.expand_path("../
|
17
|
+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
18
18
|
|
19
19
|
load 'rails/tasks/engine.rake'
|
20
20
|
load 'rails/tasks/statistics.rake'
|
@@ -31,4 +31,4 @@ desc "Run all specs in spec directory (excluding plugin specs)"
|
|
31
31
|
|
32
32
|
RSpec::Core::RakeTask.new(:spec => 'app:db:test:prepare')
|
33
33
|
|
34
|
-
task :default => :spec
|
34
|
+
task :default => :spec
|
data/config/routes.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
JiveAddOns::Engine.routes.draw do
|
2
|
-
post 'register' => "add_ons#create"
|
3
|
-
post 'unregister' => "add_ons#destroy"
|
2
|
+
post ':add_on_name/register' => "add_ons#create", :as => :register_add_on
|
3
|
+
post ':add_on_name/unregister' => "add_ons#destroy", :as => :unregister_add_on
|
4
4
|
|
5
5
|
mount JiveOsApps::Engine => "/osapps"
|
6
6
|
end
|
@@ -5,36 +5,38 @@ module JiveAddOns
|
|
5
5
|
extend ActiveSupport::Concern
|
6
6
|
|
7
7
|
def create
|
8
|
-
@add_on = JiveAddOns::AddOn.
|
9
|
-
|
8
|
+
@add_on = JiveAddOns::AddOn.new(register_params)
|
9
|
+
@add_on.uninstalled = false
|
10
|
+
@add_on.save
|
11
|
+
|
12
|
+
render :nothing => true, :status => 204
|
10
13
|
end
|
11
14
|
|
12
15
|
def destroy
|
13
16
|
@add_on = JiveAddOns::AddOn.where(unregister_params).first
|
17
|
+
@add_on.update_attributes(:uninstalled => true)
|
14
18
|
|
15
|
-
|
16
|
-
if @add_on && @add_on.update_attributes(:uninstalled => true)
|
17
|
-
format.json { render :json => {} }
|
18
|
-
else
|
19
|
-
format.json { render :json => {}, status: :not_found }
|
20
|
-
end
|
21
|
-
end
|
19
|
+
render :nothing => true, :status => 204
|
22
20
|
end
|
23
21
|
|
24
22
|
protected
|
25
23
|
def validate_authenticity
|
26
24
|
if !::Jive::SignedRequest.validate_registration(json_params)
|
27
|
-
raise
|
25
|
+
raise ActionController::BadRequest
|
28
26
|
end
|
29
27
|
end
|
30
28
|
|
29
|
+
def failure
|
30
|
+
render :nothing => true, :status => 403
|
31
|
+
end
|
32
|
+
|
31
33
|
private
|
32
34
|
def json_params
|
33
35
|
ActionController::Parameters.new(JSON.parse(request.body.read))
|
34
36
|
end
|
35
37
|
|
36
38
|
def unregister_params
|
37
|
-
|
39
|
+
json_params.tap { |whitelisted|
|
38
40
|
whitelisted[:tenant_id] = whitelisted[:tenantId]
|
39
41
|
whitelisted[:client_id] = whitelisted[:clientId]
|
40
42
|
whitelisted[:jive_url] = whitelisted[:jiveUrl]
|
data/lib/jive_add_ons/version.rb
CHANGED
@@ -1,4 +1,13 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
#
|
4
|
-
|
1
|
+
|
2
|
+
namespace :jive_add_ons do
|
3
|
+
# desc "generates add-on zip file"
|
4
|
+
task :generate => :environment do
|
5
|
+
|
6
|
+
# Dir["#{Rails.root}/config/jive_add_ons/*"].each { |file|
|
7
|
+
# extn = File.extname file # => ".mp4"
|
8
|
+
# name = File.basename file, extn # => "xyz"
|
9
|
+
# @config = YAML.load(ERB.new(File.read(file)).result)[Rails.env]
|
10
|
+
# puts @config
|
11
|
+
# }
|
12
|
+
end
|
13
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jive_add_ons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Butch Marshall
|
@@ -158,7 +158,6 @@ extensions: []
|
|
158
158
|
extra_rdoc_files: []
|
159
159
|
files:
|
160
160
|
- MIT-LICENSE
|
161
|
-
- README.rdoc
|
162
161
|
- Rakefile
|
163
162
|
- app/assets/javascripts/jive_add_ons/application.js
|
164
163
|
- app/assets/stylesheets/jive_add_ons/application.css
|
@@ -166,7 +165,6 @@ files:
|
|
166
165
|
- app/controllers/jive_add_ons/application_controller.rb
|
167
166
|
- app/helpers/jive_add_ons/application_helper.rb
|
168
167
|
- app/models/jive_add_ons/add_on.rb
|
169
|
-
- app/views/jive_add_ons/add_ons/create.erb
|
170
168
|
- app/views/layouts/jive_add_ons/application.html.erb
|
171
169
|
- config/routes.rb
|
172
170
|
- db/migrate/20150718193211_create_jive_add_ons.rb
|
data/README.rdoc
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
asdfasfasdf
|