xforum 0.0.390 → 0.0.391
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xforum.rb +27 -19
- data/lib/xforum/version.rb +1 -1
- metadata +13 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9311abced4e42f2afc2f2f216c6d96f5639749b7
|
4
|
+
data.tar.gz: be645eda103a04f47c825fcbeccdc58e948fb645
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6402dd39de8f02e23722f92bd98a445865d896d2e8a5cdcbb6172a8e58cc74bde5cb9bbe423a35a5778cbfb9dc9c1383593990f0ee7ce104431cfb93d24fc51d
|
7
|
+
data.tar.gz: 4275038cf7fee60292604ea833390011baba163c636642d4ec6df7a59fc69196df2779514019322820825d311160e59a296a3647adeb69ed935684c7e5763fc1
|
data/lib/xforum.rb
CHANGED
@@ -64,31 +64,39 @@ module Xforum
|
|
64
64
|
alist
|
65
65
|
end
|
66
66
|
|
67
|
-
def self.
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
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.
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
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
|
-
|
85
|
-
|
86
|
-
|
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
|
-
|
91
|
-
|
98
|
+
my_object=AssistMe.get_aws_object(key)
|
99
|
+
my_object.write(Pathname.new(source))
|
92
100
|
end
|
93
101
|
end
|
94
102
|
end
|
data/lib/xforum/version.rb
CHANGED
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.
|
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
|
+
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:
|
70
|
+
name: aws-sdk
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
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: '
|
82
|
+
version: '1.59'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: rails
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
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: '
|
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: '
|
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: '
|
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
|
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
|
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:
|