xforum 0.0.390 → 0.0.391

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/xforum.rb +27 -19
  3. data/lib/xforum/version.rb +1 -1
  4. metadata +13 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fd58f25b4b0f1a795f063aeb5b1c40f8eafd1470
4
- data.tar.gz: b66a2c167041cdf6b1445d774cbdcaa7bad2fcde
3
+ metadata.gz: 9311abced4e42f2afc2f2f216c6d96f5639749b7
4
+ data.tar.gz: be645eda103a04f47c825fcbeccdc58e948fb645
5
5
  SHA512:
6
- metadata.gz: 26884d6aaf716adabdb2d115904c297ac660d94acc7a021492bf92b728f0a82b091de0d04f5ebb27df9aa207f4cdd9010c93b63dc18f26a01542329e0b573f54
7
- data.tar.gz: 2887157af071e1ec8b8c1fa7b8dcc519ecfa77b76062bf67f6bfb70e62b6433504fbeef0a5781851827178e9d88b48116a168cf6e50de3b57be2a95488f31c7e
6
+ metadata.gz: 6402dd39de8f02e23722f92bd98a445865d896d2e8a5cdcbb6172a8e58cc74bde5cb9bbe423a35a5778cbfb9dc9c1383593990f0ee7ce104431cfb93d24fc51d
7
+ data.tar.gz: 4275038cf7fee60292604ea833390011baba163c636642d4ec6df7a59fc69196df2779514019322820825d311160e59a296a3647adeb69ed935684c7e5763fc1
@@ -64,31 +64,39 @@ module Xforum
64
64
  alist
65
65
  end
66
66
 
67
- def self.aws_params
68
- {server: 's3.amazonaws.com',
69
- port: 443,
70
- protocol: 'https',
71
- no_subdomains: true}
67
+ def self.get_url(source)
68
+ my_object=AssistMe.get_aws_object(source)
69
+ if ENV['USE_AWS']=='true'
70
+ my_object.url_for(:read, :expires => 60*60).to_param
71
+ else
72
+ File.join('http://localhost:3000',source)
73
+ end
72
74
  end
73
75
 
74
- def self.get_url(source,my_bucket=ENV['XFORUM_S3_BUCKET'])
75
- if ENV['XFORUM_USE_S3']=='true'
76
- begin
77
- s3 = RightAws::S3Interface.new(ENV['XFORUM_S3_ACCESS_KEY_ID'], ENV['XFORUM_S3_SECRET_ACCESS_KEY'], ForumAssist.aws_params)
78
- url= s3.get_link(my_bucket, source)
79
- temp=url.split(my_bucket)
80
- "https://#{my_bucket}.s3.amazonaws.com#{temp[1]}"
81
- rescue
82
- 'no joy'
76
+ def self.list_files(directory)
77
+ amazon_s3 = AWS::S3.new(
78
+ access_key_id:ENV['XFORUM_S3_ACCESS_KEY_ID'],
79
+ secret_access_key:ENV['XFORUM_S3_SECRET_ACCESS_KEY'])
80
+ files=[]
81
+ amazon_s3.buckets[ENV['XFORUM_S3_BUCKET']].objects.each{|object|
82
+ if object.key.include?("#{directory}/")
83
+ files.push(object.key)
83
84
  end
84
- else
85
- 'no joy'
86
- end
85
+ }
86
+ files
87
+ end
88
+
89
+ def self.get_aws_object(key,my_bucket=ENV['S3_BUCKET'])
90
+ amazon_s3 = AWS::S3.new(
91
+ access_key_id:ENV['XFORUM_S3_ACCESS_KEY_ID'],
92
+ secret_access_key:ENV['XFORUM_S3_SECRET_ACCESS_KEY'])
93
+ bucket = amazon_s3.buckets[my_bucket]
94
+ bucket.objects[key]
87
95
  end
88
96
 
89
97
  def self.save_image(source, key)
90
- amazon_s3 = RightAws::S3Interface.new(ENV['XFORUM_S3_ACCESS_KEY_ID'], ENV['XFORUM_S3_SECRET_ACCESS_KEY'], aws_params)
91
- amazon_s3.store_object_multipart(bucket: ENV['XFORUM_S3_BUCKET'], key: key, data: File.read(source))
98
+ my_object=AssistMe.get_aws_object(key)
99
+ my_object.write(Pathname.new(source))
92
100
  end
93
101
  end
94
102
  end
@@ -1,3 +1,3 @@
1
1
  module Xforum
2
- VERSION = '0.0.390'
2
+ VERSION = '0.0.391'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xforum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.390
4
+ version: 0.0.391
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert D Blanton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-26 00:00:00.000000000 Z
11
+ date: 2014-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sqlite3
@@ -67,33 +67,33 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '2.1'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rails
70
+ name: aws-sdk
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '4.1'
75
+ version: '1.59'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '4.1'
82
+ version: '1.59'
83
83
  - !ruby/object:Gem::Dependency
84
- name: right_aws
84
+ name: rails
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '3.1'
89
+ version: '4.1'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '3.1'
96
+ version: '4.1'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: coffee-rails
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '3.1'
117
+ version: '4.0'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '3.1'
124
+ version: '4.0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: jquery-form-rails
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 5.0.2
145
+ version: '5.0'
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 5.0.2
152
+ version: '5.0'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: jquery-turbolinks
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -349,3 +349,4 @@ test_files:
349
349
  - test/integration/navigation_test.rb
350
350
  - test/test_helper.rb
351
351
  - test/xforum_test.rb
352
+ has_rdoc: