social_stream-documents 0.1.12 → 0.2.0

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/.gitignore CHANGED
@@ -10,3 +10,4 @@ Gemfile.lock
10
10
  .idea/*
11
11
  .idea/social_stream-documents.iml
12
12
  app/views/*/.tmp_*
13
+ **.*swp
@@ -1,5 +1,5 @@
1
1
  <% content_for :title do %>
2
- <%= current_subject.name %>
2
+ <%= @subject.name %>
3
3
  <% end %>
4
4
 
5
5
  <% content_for :sidebar do %>
@@ -0,0 +1,25 @@
1
+ require 'social_stream/migrations/base'
2
+
3
+ module SocialStream
4
+ module Migrations
5
+ class Documents < Base
6
+ def initialize
7
+ super
8
+
9
+ @documents = find_migration('social_stream-documents')
10
+ end
11
+
12
+ def up
13
+ super
14
+
15
+ ActiveRecord::Migrator.migrate @documents
16
+ end
17
+
18
+ def down
19
+ ActiveRecord::Migrator.migrate @documents, 0
20
+
21
+ super
22
+ end
23
+ end
24
+ end
25
+ end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "social_stream-documents"
3
- s.version = "0.1.12"
3
+ s.version = "0.2.0"
4
4
  s.authors = ["Víctor Sánchez Belmar", "GING - DIT - UPM"]
5
5
  s.summary = "File capabilities for Social Stream, the core for building social network websites"
6
6
  s.description = "Social Stream is a Ruby on Rails engine providing your application with social networking features and activity streams.\n\nThis gem allow you upload almost any kind of file as new social stream activity."
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
9
9
  s.files = `git ls-files`.split("\n")
10
10
 
11
11
  # Gem dependencies
12
- s.add_runtime_dependency('social_stream-base','~> 0.7.2')
12
+ s.add_runtime_dependency('social_stream-base','~> 0.7.10')
13
13
  s.add_runtime_dependency('paperclip-ffmpeg', '~> 0.7.0')
14
14
  s.add_runtime_dependency('paperclip','2.3.11')
15
15
  # Development Gem dependencies
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
17
17
  if RUBY_VERSION < '1.9'
18
18
  s.add_development_dependency('ruby-debug', '~> 0.10.3')
19
19
  end
20
- s.add_development_dependency('rspec-rails', '~> 2.5.0')
20
+ s.add_development_dependency('rspec-rails', '~> 2.6.0')
21
21
  s.add_development_dependency('factory_girl', '~> 1.3.2')
22
22
  s.add_development_dependency('forgery', '~> 0.3.6')
23
23
  s.add_development_dependency('capybara', '~> 0.3.9')
@@ -0,0 +1,17 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe PicturesController do
4
+ render_views
5
+
6
+ context "with public picture" do
7
+ before do
8
+ @picture = Factory(:public_picture)
9
+ end
10
+
11
+ it "should render index" do
12
+ get :index, :user_id => @picture.post_activity.receiver.to_param
13
+
14
+ response.should be_success
15
+ end
16
+ end
17
+ end
@@ -0,0 +1 @@
1
+ documents
@@ -0,0 +1,176 @@
1
+ # Use this hook to configure devise mailer, warden hooks and so forth. The first
2
+ # four configuration values can also be set straight in your models.
3
+ Devise.setup do |config|
4
+ # ==> Mailer Configuration
5
+ # Configure the e-mail address which will be shown in DeviseMailer.
6
+ config.mailer_sender = "please-change-me@config-initializers-devise.com"
7
+
8
+ # Configure the class responsible to send e-mails.
9
+ # config.mailer = "Devise::Mailer"
10
+
11
+ # ==> ORM configuration
12
+ # Load and configure the ORM. Supports :active_record (default) and
13
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
14
+ # available as additional gems.
15
+ require 'devise/orm/active_record'
16
+
17
+ # ==> Configuration for any authentication mechanism
18
+ # Configure which keys are used when authenticating a user. The default is
19
+ # just :email. You can configure it to use [:username, :subdomain], so for
20
+ # authenticating a user, both parameters are required. Remember that those
21
+ # parameters are used only when authenticating and not when retrieving from
22
+ # session. If you need permissions, you should implement that in a before filter.
23
+ # You can also supply a hash where the value is a boolean determining whether
24
+ # or not authentication should be aborted when the value is not present.
25
+ # config.authentication_keys = [ :email ]
26
+
27
+ # Configure parameters from the request object used for authentication. Each entry
28
+ # given should be a request method and it will automatically be passed to the
29
+ # find_for_authentication method and considered in your model lookup. For instance,
30
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
31
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
32
+ # config.request_keys = []
33
+
34
+ # Configure which authentication keys should be case-insensitive.
35
+ # These keys will be downcased upon creating or modifying a user and when used
36
+ # to authenticate or find a user. Default is :email.
37
+ # config.case_insensitive_keys = [ :email ]
38
+
39
+ # Tell if authentication through request.params is enabled. True by default.
40
+ # config.params_authenticatable = true
41
+
42
+ # Tell if authentication through HTTP Basic Auth is enabled. False by default.
43
+ # config.http_authenticatable = false
44
+
45
+ # If http headers should be returned for AJAX requests. True by default.
46
+ # config.http_authenticatable_on_xhr = true
47
+
48
+ # The realm used in Http Basic Authentication. "Application" by default.
49
+ # config.http_authentication_realm = "Application"
50
+
51
+ # ==> Configuration for :database_authenticatable
52
+ # For bcrypt, this is the cost for hashing the password and defaults to 10. If
53
+ # using other encryptors, it sets how many times you want the password re-encrypted.
54
+ config.stretches = 10
55
+
56
+ # ==> Configuration for :confirmable
57
+ # The time you want to give your user to confirm his account. During this time
58
+ # he will be able to access your application without confirming. Default is 0.days
59
+ # When confirm_within is zero, the user won't be able to sign in without confirming.
60
+ # You can use this to let your user access some features of your application
61
+ # without confirming the account, but blocking it after a certain period
62
+ # (ie 2 days).
63
+ # config.confirm_within = 2.days
64
+
65
+ # ==> Configuration for :rememberable
66
+ # The time the user will be remembered without asking for credentials again.
67
+ # config.remember_for = 2.weeks
68
+
69
+ # If true, a valid remember token can be re-used between multiple browsers.
70
+ # config.remember_across_browsers = true
71
+
72
+ # If true, extends the user's remember period when remembered via cookie.
73
+ # config.extend_remember_period = false
74
+
75
+ # If true, uses the password salt as remember token. This should be turned
76
+ # to false if you are not using database authenticatable.
77
+ config.use_salt_as_remember_token = true
78
+
79
+ # ==> Configuration for :validatable
80
+ # Range for password length. Default is 6..20.
81
+ # config.password_length = 6..20
82
+
83
+ # Regex to use to validate the email address
84
+ # config.email_regexp = /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i
85
+
86
+ # ==> Configuration for :timeoutable
87
+ # The time you want to timeout the user session without activity. After this
88
+ # time the user will be asked for credentials again. Default is 30 minutes.
89
+ # config.timeout_in = 30.minutes
90
+
91
+ # ==> Configuration for :lockable
92
+ # Defines which strategy will be used to lock an account.
93
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
94
+ # :none = No lock strategy. You should handle locking by yourself.
95
+ # config.lock_strategy = :failed_attempts
96
+
97
+ # Defines which strategy will be used to unlock an account.
98
+ # :email = Sends an unlock link to the user email
99
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
100
+ # :both = Enables both strategies
101
+ # :none = No unlock strategy. You should handle unlocking by yourself.
102
+ # config.unlock_strategy = :both
103
+
104
+ # Number of authentication tries before locking an account if lock_strategy
105
+ # is failed attempts.
106
+ # config.maximum_attempts = 20
107
+
108
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
109
+ # config.unlock_in = 1.hour
110
+
111
+ # ==> Configuration for :encryptable
112
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
113
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
114
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
115
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
116
+ # REST_AUTH_SITE_KEY to pepper)
117
+ # config.encryptor = :sha512
118
+
119
+ # Setup a pepper to generate the encrypted password.
120
+ # config.pepper = "6efecaefd488a07abded679d45be30dc97935d74c44825b647149a6fa30ee8cd5e05bb3a426ce8a87fcd75b04079b1bac68a079acdcc175800c4131dde7961f0"
121
+
122
+ # ==> Configuration for :token_authenticatable
123
+ # Defines name of the authentication token params key
124
+ # config.token_authentication_key = :auth_token
125
+
126
+ # If true, authentication through token does not store user in session and needs
127
+ # to be supplied on each request. Useful if you are using the token as API token.
128
+ # config.stateless_token = false
129
+
130
+ # ==> Scopes configuration
131
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
132
+ # "users/sessions/new". It's turned off by default because it's slower if you
133
+ # are using only default views.
134
+ # config.scoped_views = false
135
+
136
+ # Configure the default scope given to Warden. By default it's the first
137
+ # devise role declared in your routes (usually :user).
138
+ # config.default_scope = :user
139
+
140
+ # Configure sign_out behavior.
141
+ # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
142
+ # The default is true, which means any logout action will sign out all active scopes.
143
+ # config.sign_out_all_scopes = true
144
+
145
+ # ==> Navigation configuration
146
+ # Lists the formats that should be treated as navigational. Formats like
147
+ # :html, should redirect to the sign in page when the user does not have
148
+ # access, but formats like :xml or :json, should return 401.
149
+ #
150
+ # If you have any extra navigational formats, like :iphone or :mobile, you
151
+ # should add them to the navigational formats lists.
152
+ #
153
+ # The :"*/*" format below is required to match Internet Explorer requests.
154
+ # config.navigational_formats = [:"*/*", :html]
155
+
156
+ # The default HTTP method used to sign out a resource. Default is :get.
157
+ # config.sign_out_via = :get
158
+
159
+ # ==> OmniAuth
160
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
161
+ # up on your models and hooks.
162
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
163
+ config.omniauth :linked_in, "ekxfXU8nueVSMQ9fc5KJAryBkyztUlCBYMW3DoQPzbE79WhivvzhQloRNHCHgPeB", "WYiHFT-KKFgjd45W3-pEAficmXRHmN6_6DGwj1C_ZILJlSO1gBvv6VNYXU9tybGY"
164
+
165
+ config.omniauth :facebook, "129571360447856","eef39dce5e20e76f77495c59623bdb38"
166
+
167
+ # ==> Warden configuration
168
+ # If you want to use other strategies, that are not supported by Devise, or
169
+ # change the failure app, you can configure them inside the config.warden block.
170
+ #
171
+ # config.warden do |manager|
172
+ # manager.failure_app = AnotherApp
173
+ # manager.intercept_401 = false
174
+ # manager.default_strategies(:scope => :user).unshift :some_external_strategy
175
+ # end
176
+ end
File without changes
@@ -0,0 +1,39 @@
1
+ # Default relations for Social Stream
2
+ #
3
+ # Define the default relations and permissions supported by your application
4
+ # Though subjects can customize their own relations, these are the defaults
5
+ # to start up
6
+ #
7
+ # Detailed information on permissions is available at:
8
+ # http://rdoc.info/gems/social_stream/Permission
9
+ #
10
+ user:
11
+ friend:
12
+ name: friend
13
+ permissions:
14
+ - [ follow ]
15
+ - [ create, activity ]
16
+ - [ read, activity ]
17
+ acquaintance:
18
+ name: acquaintance
19
+ permissions:
20
+ - [ read, activity ]
21
+ colleague:
22
+ name: colleague
23
+ permissions:
24
+ - [ follow ]
25
+ - [ create, activity ]
26
+ - [ read, activity ]
27
+
28
+ group:
29
+ member:
30
+ name: member
31
+ permissions:
32
+ - [ represent ]
33
+ - [ create, activity ]
34
+ - [ read, activity ]
35
+ - [ read, tie ]
36
+ partner:
37
+ name: partner
38
+ permissions:
39
+ - [ read, activity ]
@@ -1,4 +1,6 @@
1
1
  Dummy::Application.routes.draw do
2
+ devise_for :users, :controllers => {:omniauth_callbacks => 'omniauth_callbacks'}
3
+
2
4
  # The priority is based upon order of creation:
3
5
  # first created -> highest priority.
4
6
 
@@ -0,0 +1,12 @@
1
+ Factory.define :picture do |p|
2
+ p.file { Rack::Test::UploadedFile.new(File.join(File.dirname(__FILE__), 'files', 'rails.png'),
3
+ 'image/png') }
4
+
5
+ p._contact_id { Factory(:friend).contact_id }
6
+ p._relation_ids { |q| Array(Contact.find(q._contact_id).sender.relation_customs.sort.first.id) }
7
+ end
8
+
9
+ Factory.define :public_picture, :parent => :picture do |p|
10
+ p._contact_id { Factory(:self_contact).id }
11
+ p._relation_ids { |q| Array(Contact.find(q._contact_id).sender.relation_public.id) }
12
+ end
@@ -16,12 +16,19 @@ require "capybara/rails"
16
16
  Capybara.default_driver = :rack_test
17
17
  Capybara.default_selector = :css
18
18
 
19
- # Run any available migration
20
- ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)
19
+ ActiveRecord::Migration.verbose = false
21
20
 
22
21
  # Load support files
23
22
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
24
23
 
24
+ # Load Factories
25
+ require 'factory_girl'
26
+ base_path = File.join(Gem::GemPathSearcher.new.find('social_stream-base').full_gem_path, 'spec')
27
+ [ base_path, File.dirname(__FILE__) ].each do |path|
28
+ Dir["#{path}/factories/*.rb"].each {|f| require f}
29
+ end
30
+
31
+ =begin
25
32
  RSpec.configure do |config|
26
33
  # Remove this line if you don't want RSpec's should and should_not
27
34
  # methods or matchers
@@ -31,3 +38,4 @@ RSpec.configure do |config|
31
38
  # == Mock Framework
32
39
  config.mock_with :rspec
33
40
  end
41
+ =end
@@ -0,0 +1 @@
1
+ require 'cancan/matchers'
@@ -0,0 +1,5 @@
1
+ require 'social_stream/migrations/documents'
2
+
3
+ SocialStream::Migrations::Documents.new.down
4
+
5
+ SocialStream::Migrations::Documents.new.up
@@ -0,0 +1,4 @@
1
+ RSpec.configure do |config|
2
+ # Add authentication helpers
3
+ config.include Devise::TestHelpers, :type => :controller
4
+ end
@@ -0,0 +1,4 @@
1
+ RSpec.configure do |config|
2
+ # == Mock Framework
3
+ config.mock_with :rspec
4
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: social_stream-documents
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
5
- prerelease: false
4
+ hash: 23
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
- - 1
9
- - 12
10
- version: 0.1.12
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - "V\xC3\xADctor S\xC3\xA1nchez Belmar"
@@ -16,26 +16,28 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-07-27 00:00:00 +02:00
19
+ date: 2011-07-28 00:00:00 +02:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
+ prerelease: false
24
+ type: :runtime
23
25
  requirement: &id001 !ruby/object:Gem::Requirement
24
26
  none: false
25
27
  requirements:
26
28
  - - ~>
27
29
  - !ruby/object:Gem::Version
28
- hash: 7
30
+ hash: 23
29
31
  segments:
30
32
  - 0
31
33
  - 7
32
- - 2
33
- version: 0.7.2
34
- type: :runtime
34
+ - 10
35
+ version: 0.7.10
35
36
  name: social_stream-base
36
- prerelease: false
37
37
  version_requirements: *id001
38
38
  - !ruby/object:Gem::Dependency
39
+ prerelease: false
40
+ type: :runtime
39
41
  requirement: &id002 !ruby/object:Gem::Requirement
40
42
  none: false
41
43
  requirements:
@@ -47,11 +49,11 @@ dependencies:
47
49
  - 7
48
50
  - 0
49
51
  version: 0.7.0
50
- type: :runtime
51
52
  name: paperclip-ffmpeg
52
- prerelease: false
53
53
  version_requirements: *id002
54
54
  - !ruby/object:Gem::Dependency
55
+ prerelease: false
56
+ type: :runtime
55
57
  requirement: &id003 !ruby/object:Gem::Requirement
56
58
  none: false
57
59
  requirements:
@@ -63,11 +65,11 @@ dependencies:
63
65
  - 3
64
66
  - 11
65
67
  version: 2.3.11
66
- type: :runtime
67
68
  name: paperclip
68
- prerelease: false
69
69
  version_requirements: *id003
70
70
  - !ruby/object:Gem::Dependency
71
+ prerelease: false
72
+ type: :development
71
73
  requirement: &id004 !ruby/object:Gem::Requirement
72
74
  none: false
73
75
  requirements:
@@ -77,11 +79,11 @@ dependencies:
77
79
  segments:
78
80
  - 0
79
81
  version: "0"
80
- type: :development
81
82
  name: sqlite3-ruby
82
- prerelease: false
83
83
  version_requirements: *id004
84
84
  - !ruby/object:Gem::Dependency
85
+ prerelease: false
86
+ type: :development
85
87
  requirement: &id005 !ruby/object:Gem::Requirement
86
88
  none: false
87
89
  requirements:
@@ -93,27 +95,27 @@ dependencies:
93
95
  - 10
94
96
  - 3
95
97
  version: 0.10.3
96
- type: :development
97
98
  name: ruby-debug
98
- prerelease: false
99
99
  version_requirements: *id005
100
100
  - !ruby/object:Gem::Dependency
101
+ prerelease: false
102
+ type: :development
101
103
  requirement: &id006 !ruby/object:Gem::Requirement
102
104
  none: false
103
105
  requirements:
104
106
  - - ~>
105
107
  - !ruby/object:Gem::Version
106
- hash: 27
108
+ hash: 23
107
109
  segments:
108
110
  - 2
109
- - 5
111
+ - 6
110
112
  - 0
111
- version: 2.5.0
112
- type: :development
113
+ version: 2.6.0
113
114
  name: rspec-rails
114
- prerelease: false
115
115
  version_requirements: *id006
116
116
  - !ruby/object:Gem::Dependency
117
+ prerelease: false
118
+ type: :development
117
119
  requirement: &id007 !ruby/object:Gem::Requirement
118
120
  none: false
119
121
  requirements:
@@ -125,11 +127,11 @@ dependencies:
125
127
  - 3
126
128
  - 2
127
129
  version: 1.3.2
128
- type: :development
129
130
  name: factory_girl
130
- prerelease: false
131
131
  version_requirements: *id007
132
132
  - !ruby/object:Gem::Dependency
133
+ prerelease: false
134
+ type: :development
133
135
  requirement: &id008 !ruby/object:Gem::Requirement
134
136
  none: false
135
137
  requirements:
@@ -141,11 +143,11 @@ dependencies:
141
143
  - 3
142
144
  - 6
143
145
  version: 0.3.6
144
- type: :development
145
146
  name: forgery
146
- prerelease: false
147
147
  version_requirements: *id008
148
148
  - !ruby/object:Gem::Dependency
149
+ prerelease: false
150
+ type: :development
149
151
  requirement: &id009 !ruby/object:Gem::Requirement
150
152
  none: false
151
153
  requirements:
@@ -157,9 +159,7 @@ dependencies:
157
159
  - 3
158
160
  - 9
159
161
  version: 0.3.9
160
- type: :development
161
162
  name: capybara
162
- prerelease: false
163
163
  version_requirements: *id009
164
164
  description: |-
165
165
  Social Stream is a Ruby on Rails engine providing your application with social networking features and activity streams.
@@ -268,7 +268,10 @@ files:
268
268
  - lib/generators/social_stream/documents/install_generator.rb
269
269
  - lib/social_stream-documents.rb
270
270
  - lib/social_stream/documents/engine.rb
271
+ - lib/social_stream/migrations/documents.rb
271
272
  - social_stream-documents.gemspec
273
+ - spec/controllers/pictures_controller_spec.rb
274
+ - spec/dummy/.gitignore
272
275
  - spec/dummy/Rakefile
273
276
  - spec/dummy/app/controllers/application_controller.rb
274
277
  - spec/dummy/app/helpers/application_helper.rb
@@ -282,11 +285,14 @@ files:
282
285
  - spec/dummy/config/environments/production.rb
283
286
  - spec/dummy/config/environments/test.rb
284
287
  - spec/dummy/config/initializers/backtrace_silencers.rb
288
+ - spec/dummy/config/initializers/devise.rb
285
289
  - spec/dummy/config/initializers/inflections.rb
286
290
  - spec/dummy/config/initializers/mime_types.rb
287
291
  - spec/dummy/config/initializers/secret_token.rb
288
292
  - spec/dummy/config/initializers/session_store.rb
289
293
  - spec/dummy/config/locales/en.yml
294
+ - spec/dummy/config/navigation.rb
295
+ - spec/dummy/config/relations.yml
290
296
  - spec/dummy/config/routes.rb
291
297
  - spec/dummy/public/404.html
292
298
  - spec/dummy/public/422.html
@@ -300,10 +306,16 @@ files:
300
306
  - spec/dummy/public/javascripts/rails.js
301
307
  - spec/dummy/public/stylesheets/.gitkeep
302
308
  - spec/dummy/script/rails
309
+ - spec/factories/files/rails.png
310
+ - spec/factories/picture.rb
303
311
  - spec/integration/navigation_spec.rb
304
312
  - spec/models/video_spec.rb
305
313
  - spec/socialstream_documents_spec.rb
306
314
  - spec/spec_helper.rb
315
+ - spec/support/cancan.rb
316
+ - spec/support/db.rb
317
+ - spec/support/devise.rb
318
+ - spec/support/mock.rb
307
319
  - vendor/assets/javascripts/jquery.jplayer.js
308
320
  - vendor/assets/stylesheets/jplayer.blue.monday.css
309
321
  - vendor/assets/stylesheets/jplayer.blue.monday.jpg
@@ -340,7 +352,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
340
352
  requirements: []
341
353
 
342
354
  rubyforge_project:
343
- rubygems_version: 1.3.7
355
+ rubygems_version: 1.6.2
344
356
  signing_key:
345
357
  specification_version: 3
346
358
  summary: File capabilities for Social Stream, the core for building social network websites