cloudstrg 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -63,6 +63,21 @@ module CloudStrg
63
63
  def create_file params
64
64
  raise NotImplementedError
65
65
  end
66
+
67
+ ###
68
+ # This method performs the creation of a file.
69
+ #
70
+ # Params: the "params" variable must contain the following fields
71
+ # filename: the name of the file to create,
72
+ # file: the file to upload.
73
+ # mimetype: the mimetype of the file,
74
+ #
75
+ # Returns:
76
+ # This method returns the local id of the remote object if the operation success, otherwise it returns false.
77
+ #
78
+ def create_generic_file params
79
+ raise NotImplementedError
80
+ end
66
81
 
67
82
  #def create_folder params
68
83
  # raise NotImplementedError
@@ -135,6 +150,21 @@ module CloudStrg
135
150
  raise NotImplementedError
136
151
  end
137
152
 
153
+ ###
154
+ # This method allows a user to share a file with anyone.
155
+ #
156
+ # Params: the "params" variable must contain the following fields
157
+ # file_id: the id of the file,
158
+ # local_file_id: the local id of the file,
159
+ # user_id: the id of the user we want to grant.
160
+ #
161
+ # Returns:
162
+ # This method returns non-nil data if success.
163
+ #
164
+ def share_public_file params
165
+ raise NotImplementedError
166
+ end
167
+
138
168
  ###
139
169
  # This method allows a user to revoke a file's permission to other users.
140
170
  #
@@ -165,7 +195,7 @@ module CloudStrg
165
195
  puts plugin_name
166
196
  plugin = Cloudstrg::Cloudstrgplugin.find_by_plugin_name(plugin_name)
167
197
 
168
- file = Cloudstrg::Remoteobject.where(:user_id => user.id, :cloudstrgplugin_id => plugin.id, :filename => filename)
198
+ file = Cloudstrg::Remoteobject.where(:user_id => user.id, :cloudstrgplugin_id => plugin.id, :file_remote_id => file_remote_id)
169
199
  if not file.empty?
170
200
  file = file[0]
171
201
  file.filehash = filecontent.hash.to_s
@@ -63,6 +63,21 @@ module CloudStrg
63
63
  def create_file params
64
64
  raise NotImplementedError
65
65
  end
66
+
67
+ ###
68
+ # This method performs the creation of a file.
69
+ #
70
+ # Params: the "params" variable must contain the following fields
71
+ # filename: the name of the file to create,
72
+ # file: the file to upload.
73
+ # mimetype: the mimetype of the file,
74
+ #
75
+ # Returns:
76
+ # This method returns the local id of the remote object if the operation success, otherwise it returns false.
77
+ #
78
+ def create_generic_file params
79
+ raise NotImplementedError
80
+ end
66
81
 
67
82
  #def create_folder params
68
83
  # raise NotImplementedError
@@ -135,11 +150,25 @@ module CloudStrg
135
150
  raise NotImplementedError
136
151
  end
137
152
 
153
+ ###
154
+ # This method allows a user to share a file with anyone.
155
+ #
156
+ # Params: the "params" variable must contain the following fields
157
+ # file_id: the id of the file,
158
+ # local_file_id: the local id of the file,
159
+ # user_id: the id of the user we want to grant.
160
+ #
161
+ # Returns:
162
+ # This method returns non-nil data if success.
163
+ #
164
+ def share_public_file params
165
+ raise NotImplementedError
166
+ end
167
+
138
168
  ###
139
169
  # This method allows a user to revoke a file's permission to other users.
140
170
  #
141
171
  # Params: the "params" variable must contain the following fields
142
- # permission_id: the id of the permission we want to revoke,
143
172
  # file_id: the id of the file,
144
173
  # local_file_id: the local id of the file,
145
174
  # user_id: the id of the target user.
@@ -1,3 +1,3 @@
1
1
  module Cloudstrg
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
@@ -1,3 +1,3 @@
1
1
  module Cloudstrg
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
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.12
4
+ version: 0.0.13
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: 2013-03-15 00:00:00.000000000 Z
12
+ date: 2013-05-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails