muck-invites 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/controllers/muck/invites_controller.rb +3 -1
- data/locales/en.yml +1 -0
- data/muck-invites.gemspec +7 -4
- data/test/rails_root/Gemfile +51 -0
- data/test/rails_root/config/boot.rb +14 -0
- data/test/rails_root/config/environment.rb +1 -17
- data/test/rails_root/config/preinitializer.rb +20 -0
- data/test/rails_root/test/functional/invites_controller_test.rb +28 -0
- metadata +16 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.12
|
@@ -47,11 +47,13 @@ class Muck::InvitesController < ApplicationController
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def create
|
50
|
-
if params[:emails]
|
50
|
+
if params[:emails] && !params[:emails].blank?
|
51
51
|
emails = params[:emails]
|
52
52
|
emails = emails.join(', ') if emails.is_a?(Array)
|
53
53
|
current_user.invite(params[:emails], params[:message], current_user)
|
54
54
|
@message = t('muck.invites.create_success', :emails => emails, :app_name => GlobalConfig.application_name)
|
55
|
+
else
|
56
|
+
@message = t('muck.invites.emails_empty')
|
55
57
|
end
|
56
58
|
respond_to do |format|
|
57
59
|
format.html do
|
data/locales/en.yml
CHANGED
@@ -10,6 +10,7 @@ en:
|
|
10
10
|
invite_friends: Invite your friends to join {{app_name}}
|
11
11
|
email_password_help: The password of your email account
|
12
12
|
create_success: Invites were sent to {{emails}}. You will be notified if they join {{app_name}}
|
13
|
+
emails_empty: You didn't specify any emails
|
13
14
|
we_wont_email: We won't email these addresses without your permission.
|
14
15
|
invited_joined: "{{user}} joined {{app_name}}"
|
15
16
|
retrieving_contacts: Retrieving contacts
|
data/muck-invites.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{muck-invites}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.12"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Justin Ball, Joel Duffin"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-05-31}
|
13
13
|
s.description = %q{The invite engine for the muck system.}
|
14
14
|
s.email = %q{justin@tatemae.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -104,6 +104,7 @@ Gem::Specification.new do |s|
|
|
104
104
|
"test/rails_root/.gitignore",
|
105
105
|
"test/rails_root/.rake_tasks",
|
106
106
|
"test/rails_root/Capfile",
|
107
|
+
"test/rails_root/Gemfile",
|
107
108
|
"test/rails_root/Rakefile",
|
108
109
|
"test/rails_root/app/controllers/application_controller.rb",
|
109
110
|
"test/rails_root/app/controllers/default_controller.rb",
|
@@ -129,6 +130,7 @@ Gem::Specification.new do |s|
|
|
129
130
|
"test/rails_root/config/initializers/oauth_consumers.rb",
|
130
131
|
"test/rails_root/config/initializers/requires.rb",
|
131
132
|
"test/rails_root/config/initializers/session_store.rb",
|
133
|
+
"test/rails_root/config/preinitializer.rb",
|
132
134
|
"test/rails_root/config/routes.rb",
|
133
135
|
"test/rails_root/db/.keep",
|
134
136
|
"test/rails_root/db/migrate/20090320174818_create_muck_permissions_and_roles.rb",
|
@@ -771,7 +773,7 @@ Gem::Specification.new do |s|
|
|
771
773
|
s.rdoc_options = ["--charset=UTF-8"]
|
772
774
|
s.require_paths = ["lib"]
|
773
775
|
s.rubyforge_project = %q{muck-invites}
|
774
|
-
s.rubygems_version = %q{1.3.
|
776
|
+
s.rubygems_version = %q{1.3.7}
|
775
777
|
s.summary = %q{The invite engine for the muck system}
|
776
778
|
s.test_files = [
|
777
779
|
"test/rails_root/app/controllers/application_controller.rb",
|
@@ -793,6 +795,7 @@ Gem::Specification.new do |s|
|
|
793
795
|
"test/rails_root/config/initializers/oauth_consumers.rb",
|
794
796
|
"test/rails_root/config/initializers/requires.rb",
|
795
797
|
"test/rails_root/config/initializers/session_store.rb",
|
798
|
+
"test/rails_root/config/preinitializer.rb",
|
796
799
|
"test/rails_root/config/routes.rb",
|
797
800
|
"test/rails_root/db/migrate/20090320174818_create_muck_permissions_and_roles.rb",
|
798
801
|
"test/rails_root/db/migrate/20090327231918_create_users.rb",
|
@@ -842,7 +845,7 @@ Gem::Specification.new do |s|
|
|
842
845
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
843
846
|
s.specification_version = 3
|
844
847
|
|
845
|
-
if Gem::Version.new(Gem::
|
848
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
846
849
|
s.add_runtime_dependency(%q<contacts>, [">= 0"])
|
847
850
|
s.add_runtime_dependency(%q<muck-engine>, [">= 0"])
|
848
851
|
else
|
@@ -0,0 +1,51 @@
|
|
1
|
+
source :gemcutter
|
2
|
+
|
3
|
+
gem "rails", "2.3.5"
|
4
|
+
gem 'mysql'
|
5
|
+
gem "authlogic", '2.1.3'
|
6
|
+
gem 'oauth', '~> 0.3.6'
|
7
|
+
gem 'oauth-plugin', '~> 0.3.14'
|
8
|
+
gem 'twitter', '~> 0.9.5'
|
9
|
+
gem 'linkedin', '~> 0.1.2'
|
10
|
+
gem 'fireeagle', '~> 0.8.0.1'
|
11
|
+
gem 'agree2', '~> 0.2.0'
|
12
|
+
gem 'portablecontacts', '~> 0.1.0'
|
13
|
+
gem 'hpricot', '0.8.2'
|
14
|
+
gem "contacts", '1.2.3'
|
15
|
+
gem 'muck-engine', '0.4.27', :require => 'muck_engine'
|
16
|
+
gem 'muck-users', '0.3.13', :require => 'muck_users'
|
17
|
+
gem 'muck-profiles', '0.2.1', :require => 'muck_profiles'
|
18
|
+
gem 'muck-oauth', '0.2.2', :require => 'muck_oauth'
|
19
|
+
gem 'muck-activities', '0.1.27',:require => 'muck_activities'
|
20
|
+
gem 'muck-invites', :require => 'muck_invites', :path => File.join(File.dirname(__FILE__), *%w(.. .. ..))
|
21
|
+
|
22
|
+
group :development do
|
23
|
+
gem 'ruby-debug'
|
24
|
+
|
25
|
+
# gem 'muck-engine', :require => 'muck_engine', :path => "~/projects/muck-engine"
|
26
|
+
# gem 'muck-users', :require => 'muck_users', :path => "~/projects/muck-users"
|
27
|
+
# gem 'muck-activities', :require => 'muck_activities', :path => "~/projects/muck-activities"
|
28
|
+
# gem 'muck-profiles', :require => 'muck_profiles', :path => "~/projects/muck-profiles"
|
29
|
+
# gem 'muck-oauth', :require => 'muck_oauth', :path => "~/projects/muck-oauth"
|
30
|
+
end
|
31
|
+
|
32
|
+
group :test do
|
33
|
+
# bundler requires these gems while running tests
|
34
|
+
gem 'ruby-debug'
|
35
|
+
gem 'mocha', '>= 0.9.8'
|
36
|
+
gem 'redgreen'
|
37
|
+
gem 'factory_girl'
|
38
|
+
gem 'shoulda'
|
39
|
+
gem 'treetop', '>=1.2.4'
|
40
|
+
gem 'term-ansicolor', '>=1.0.3', :require => 'term/ansicolor'
|
41
|
+
gem 'cucumber', '>=0.1.13', :require => 'cucumber'
|
42
|
+
gem 'polyglot', '>=0.2.4'
|
43
|
+
gem "rcov", '>=0.8.1.2.0'
|
44
|
+
gem "webrat", '>=0.4.4'
|
45
|
+
gem 'redgreen'
|
46
|
+
# gem 'rspec', '>=1.1.12', :require_as => 'spec'
|
47
|
+
# gem 'rspec-rails', '>=1.1.12', :require_as => 'spec/rails'
|
48
|
+
# only required if you want to use selenium for testing
|
49
|
+
#gem 'selenium-client', :require_as => 'selenium/client'
|
50
|
+
#gem 'database_cleaner'
|
51
|
+
end
|
@@ -105,5 +105,19 @@ module Rails
|
|
105
105
|
end
|
106
106
|
end
|
107
107
|
|
108
|
+
class Rails::Boot
|
109
|
+
def run
|
110
|
+
load_initializer
|
111
|
+
|
112
|
+
Rails::Initializer.class_eval do
|
113
|
+
def load_gems
|
114
|
+
@bundler_loaded ||= Bundler.require :default, Rails.env
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
Rails::Initializer.run(:set_load_path)
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
108
122
|
# All that for this:
|
109
123
|
Rails.boot!
|
@@ -1,4 +1,4 @@
|
|
1
|
-
RAILS_GEM_VERSION = '2.3.
|
1
|
+
RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
|
2
2
|
|
3
3
|
require File.join(File.dirname(__FILE__), 'boot')
|
4
4
|
|
@@ -7,22 +7,6 @@ require 'ostruct'
|
|
7
7
|
require 'yaml'
|
8
8
|
::GlobalConfig = OpenStruct.new(YAML.load_file("#{RAILS_ROOT}/config/global_config.yml")[RAILS_ENV])
|
9
9
|
|
10
|
-
class TestGemLocator < Rails::Plugin::Locator
|
11
|
-
def plugins
|
12
|
-
Rails::Plugin.new(File.join(File.dirname(__FILE__), *%w(.. .. ..)))
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
10
|
Rails::Initializer.run do |config|
|
17
11
|
config.time_zone = 'UTC'
|
18
|
-
config.gem "authlogic"
|
19
|
-
config.gem "contacts"
|
20
|
-
config.gem 'muck-engine', :lib => 'muck_engine'
|
21
|
-
config.gem 'muck-users', :lib => 'muck_users'
|
22
|
-
config.gem 'muck-profiles', :lib => 'muck_profiles'
|
23
|
-
config.gem "oauth"
|
24
|
-
config.gem "oauth-plugin"
|
25
|
-
config.gem 'muck-oauth', :lib => 'muck_oauth'
|
26
|
-
config.gem 'muck-activities', :lib => 'muck_activities'
|
27
|
-
config.plugin_locators << TestGemLocator
|
28
12
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
begin
|
2
|
+
require "rubygems"
|
3
|
+
require "bundler"
|
4
|
+
rescue LoadError
|
5
|
+
raise "Could not load the bundler gem. Install it with `gem install bundler`."
|
6
|
+
end
|
7
|
+
|
8
|
+
if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.24")
|
9
|
+
raise RuntimeError, "Your bundler version is too old." +
|
10
|
+
"Run `gem install bundler` to upgrade."
|
11
|
+
end
|
12
|
+
|
13
|
+
begin
|
14
|
+
# Set up load paths for all bundled gems
|
15
|
+
ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__)
|
16
|
+
Bundler.setup
|
17
|
+
rescue Bundler::GemNotFound
|
18
|
+
raise RuntimeError, "Bundler couldn't find some gems." +
|
19
|
+
"Did you run `bundle install`?"
|
20
|
+
end
|
@@ -66,6 +66,34 @@ class Muck::InvitesControllerTest < ActionController::TestCase
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
end
|
69
|
+
context "empty emails" do
|
70
|
+
context "html" do
|
71
|
+
setup do
|
72
|
+
post :create, :emails => ""
|
73
|
+
end
|
74
|
+
should "set message" do
|
75
|
+
assert_equal I18n.translate('muck.invites.emails_empty'), assigns(:message)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
context "js" do
|
79
|
+
setup do
|
80
|
+
post :create, :emails => "", :format => 'js'
|
81
|
+
end
|
82
|
+
should_respond_with :success
|
83
|
+
should "set message" do
|
84
|
+
assert_equal I18n.translate('muck.invites.emails_empty'), assigns(:message)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
context "pjs" do
|
88
|
+
setup do
|
89
|
+
post :create, :emails => "", :format => 'pjs'
|
90
|
+
end
|
91
|
+
should_respond_with :success
|
92
|
+
should "set message" do
|
93
|
+
assert_equal I18n.translate('muck.invites.emails_empty'), assigns(:message)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
69
97
|
context "string of emails" do
|
70
98
|
should "create a invite s" do
|
71
99
|
assert_difference "Invite.count", 2 do
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: muck-invites
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 3
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
9
|
+
- 12
|
10
|
+
version: 0.1.12
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Justin Ball, Joel Duffin
|
@@ -14,16 +15,18 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-
|
18
|
+
date: 2010-05-31 00:00:00 -06:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: contacts
|
22
23
|
prerelease: false
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
24
26
|
requirements:
|
25
27
|
- - ">="
|
26
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
27
30
|
segments:
|
28
31
|
- 0
|
29
32
|
version: "0"
|
@@ -33,9 +36,11 @@ dependencies:
|
|
33
36
|
name: muck-engine
|
34
37
|
prerelease: false
|
35
38
|
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
36
40
|
requirements:
|
37
41
|
- - ">="
|
38
42
|
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
39
44
|
segments:
|
40
45
|
- 0
|
41
46
|
version: "0"
|
@@ -138,6 +143,7 @@ files:
|
|
138
143
|
- test/rails_root/.gitignore
|
139
144
|
- test/rails_root/.rake_tasks
|
140
145
|
- test/rails_root/Capfile
|
146
|
+
- test/rails_root/Gemfile
|
141
147
|
- test/rails_root/Rakefile
|
142
148
|
- test/rails_root/app/controllers/application_controller.rb
|
143
149
|
- test/rails_root/app/controllers/default_controller.rb
|
@@ -163,6 +169,7 @@ files:
|
|
163
169
|
- test/rails_root/config/initializers/oauth_consumers.rb
|
164
170
|
- test/rails_root/config/initializers/requires.rb
|
165
171
|
- test/rails_root/config/initializers/session_store.rb
|
172
|
+
- test/rails_root/config/preinitializer.rb
|
166
173
|
- test/rails_root/config/routes.rb
|
167
174
|
- test/rails_root/db/.keep
|
168
175
|
- test/rails_root/db/migrate/20090320174818_create_muck_permissions_and_roles.rb
|
@@ -810,23 +817,27 @@ rdoc_options:
|
|
810
817
|
require_paths:
|
811
818
|
- lib
|
812
819
|
required_ruby_version: !ruby/object:Gem::Requirement
|
820
|
+
none: false
|
813
821
|
requirements:
|
814
822
|
- - ">="
|
815
823
|
- !ruby/object:Gem::Version
|
824
|
+
hash: 3
|
816
825
|
segments:
|
817
826
|
- 0
|
818
827
|
version: "0"
|
819
828
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
829
|
+
none: false
|
820
830
|
requirements:
|
821
831
|
- - ">="
|
822
832
|
- !ruby/object:Gem::Version
|
833
|
+
hash: 3
|
823
834
|
segments:
|
824
835
|
- 0
|
825
836
|
version: "0"
|
826
837
|
requirements: []
|
827
838
|
|
828
839
|
rubyforge_project: muck-invites
|
829
|
-
rubygems_version: 1.3.
|
840
|
+
rubygems_version: 1.3.7
|
830
841
|
signing_key:
|
831
842
|
specification_version: 3
|
832
843
|
summary: The invite engine for the muck system
|
@@ -850,6 +861,7 @@ test_files:
|
|
850
861
|
- test/rails_root/config/initializers/oauth_consumers.rb
|
851
862
|
- test/rails_root/config/initializers/requires.rb
|
852
863
|
- test/rails_root/config/initializers/session_store.rb
|
864
|
+
- test/rails_root/config/preinitializer.rb
|
853
865
|
- test/rails_root/config/routes.rb
|
854
866
|
- test/rails_root/db/migrate/20090320174818_create_muck_permissions_and_roles.rb
|
855
867
|
- test/rails_root/db/migrate/20090327231918_create_users.rb
|