cloudstrg 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/controllers/cloudstrg/configs_controller.rb +3 -0
- data/app/controllers/cloudstrg/configs_controller.rb~ +7 -2
- data/app/models/cloudstrg/remoteobject.rb +0 -2
- data/app/models/cloudstrg/remoteobject.rb~ +2 -0
- data/app/views/cloudstrg/configs/index.html.erb +5 -1
- data/app/views/cloudstrg/configs/index.html.erb~ +1 -1
- data/app/views/layouts/cloudstrg/application.html.erb +4 -0
- data/lib/cloudstrg/cloudstrg.rb +5 -3
- data/lib/cloudstrg/cloudstrg.rb~ +5 -3
- data/lib/cloudstrg/version.rb +1 -1
- metadata +2 -2
@@ -9,6 +9,11 @@ module Cloudstrg
|
|
9
9
|
# GET /configs.json
|
10
10
|
def index
|
11
11
|
@config = @user.cloudstrgconfig
|
12
|
+
if params.has_key? :redirection_url
|
13
|
+
puts params[:redirection_url]
|
14
|
+
@redirection_url = params[:redirection_url]
|
15
|
+
end
|
16
|
+
puts "Qui"
|
12
17
|
|
13
18
|
respond_to do |format|
|
14
19
|
format.html # index.html.erb
|
@@ -32,7 +37,7 @@ module Cloudstrg
|
|
32
37
|
def new
|
33
38
|
@config = @user.cloudstrgconfig
|
34
39
|
if not @config
|
35
|
-
@config = @user.
|
40
|
+
@config = @user.build_cloudstrgconfig
|
36
41
|
end
|
37
42
|
@driver_list = CloudStrg.driver_list
|
38
43
|
|
@@ -51,7 +56,7 @@ module Cloudstrg
|
|
51
56
|
# POST /configs
|
52
57
|
# POST /configs.json
|
53
58
|
def create
|
54
|
-
@config = @user.
|
59
|
+
@config = @user.build_cloudstrgconfig(params[:config])
|
55
60
|
@driver_list = CloudStrg.driver_list
|
56
61
|
|
57
62
|
respond_to do |format|
|
data/lib/cloudstrg/cloudstrg.rb
CHANGED
@@ -120,14 +120,16 @@ module CloudStrg
|
|
120
120
|
end
|
121
121
|
|
122
122
|
def save_remoteobject(user, filename, filecontent, file_remote_id)
|
123
|
-
|
123
|
+
plugin_name = self.class.to_s.split('Strg')[0].downcase
|
124
|
+
puts plugin_name
|
125
|
+
plugin = Cloudstrg::Cloudstrgplugin.find_by_plugin_name(plugin_name)
|
124
126
|
|
125
|
-
file = Cloudstrg::Remoteobject.where(:user_id => user, :cloudstrgplugin_id =>
|
127
|
+
file = Cloudstrg::Remoteobject.where(:user_id => user, :cloudstrgplugin_id => plugin, :filename => filename)
|
126
128
|
if not file.empty?
|
127
129
|
file = file[0]
|
128
130
|
file.filehash = filecontent.hash.to_s
|
129
131
|
else
|
130
|
-
file =
|
132
|
+
file = plugin.remotes.build(:user_id => user, :filename => filename, :filehash => filecontent.hash.to_s, :file_remote_id => file_remote_id)
|
131
133
|
end
|
132
134
|
file.save
|
133
135
|
return file
|
data/lib/cloudstrg/cloudstrg.rb~
CHANGED
@@ -120,14 +120,16 @@ module CloudStrg
|
|
120
120
|
end
|
121
121
|
|
122
122
|
def save_remoteobject(user, filename, filecontent, file_remote_id)
|
123
|
-
|
123
|
+
plugin_name = self.class.to_s.split('Strg')[0].downcase
|
124
|
+
puts plugin_name
|
125
|
+
plugin = Cloudstrg::Cloudstrgplugin.find_by_name(plugin_name)
|
124
126
|
|
125
|
-
file = Cloudstrg::Remoteobject.where(:user_id => user, :cloudstrgplugin_id =>
|
127
|
+
file = Cloudstrg::Remoteobject.where(:user_id => user, :cloudstrgplugin_id => plugin, :filename => filename)
|
126
128
|
if not file.empty?
|
127
129
|
file = file[0]
|
128
130
|
file.filehash = filecontent.hash.to_s
|
129
131
|
else
|
130
|
-
file =
|
132
|
+
file = plugin.remotes.build(:user_id => user, :filename => filename, :filehash => filecontent.hash.to_s, :file_remote_id => file_remote_id)
|
131
133
|
end
|
132
134
|
file.save
|
133
135
|
return file
|
data/lib/cloudstrg/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudstrg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|