refinerycms-tweets 1.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +16 -0
- data/Gemfile +7 -6
- data/README.md +23 -17
- data/Rakefile +1 -1
- data/lib/refinery/tweets/version.rb +1 -1
- data/refinerycms-tweets.gemspec +3 -3
- data/spec/{requests → features}/refinery/tweets/admin/tweets_spec.rb +2 -1
- data/spec/models/refinery/tweets/twitter_account_spec.rb +10 -10
- data/spec/spec_helper.rb +2 -0
- metadata +25 -29
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4800fbfea7c2d62322a8e26a64583c0021bc4943
|
4
|
+
data.tar.gz: 806423e04287d63bfbe5fc2f733975b1b5b78e58
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ea0216094dda0c8e722cbf01c68dcf8583591ac2da26090cc1ccf6699c3dcc87df728e82db41f3de91b8643f4f536effb6ead8ce9f4d3b20263a6d6a956cc983
|
7
|
+
data.tar.gz: 0ad9c94f1db2d496750b646c525907a854c6c234867d1ecbac789429f14f9332f88eee495b9f22661b9cbbfeb591929fbf219adb8d0680767fb82aafbbb1ca50
|
data/.travis.yml
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- "1.9.2"
|
4
|
+
- "1.9.3"
|
5
|
+
- "2.0.0"
|
6
|
+
- jruby-19mode # JRuby in 1.9 mode
|
7
|
+
- rbx-19mode
|
8
|
+
before_script:
|
9
|
+
- "bundle exec rake refinery:testing:dummy_app > /dev/null"
|
10
|
+
matrix:
|
11
|
+
allow_failures:
|
12
|
+
- rvm: rbx-19mode
|
13
|
+
- rvm: jruby-19mode
|
14
|
+
- rvm: "1.9.2"
|
15
|
+
# uncomment this line if your project needs to run something other than `rake`:
|
16
|
+
# script: bundle exec rspec spec
|
data/Gemfile
CHANGED
@@ -1,15 +1,16 @@
|
|
1
|
-
source '
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
gem 'refinerycms',
|
6
|
-
gem 'refinerycms-i18n', :git => 'git://github.com/refinery/refinerycms-i18n.git'
|
5
|
+
gem 'refinerycms', '~> 2.1.0'
|
6
|
+
gem 'refinerycms-i18n', :git => 'git://github.com/refinery/refinerycms-i18n.git',
|
7
|
+
:branch => '2-1-stable'
|
7
8
|
|
8
9
|
group :development, :test do
|
9
|
-
gem 'refinerycms-testing', :
|
10
|
+
gem 'refinerycms-testing', :github => 'refinery/refinerycms', :branch => '2-1-stable'
|
10
11
|
gem 'guard-rspec', '~> 0.6.0'
|
11
|
-
gem
|
12
|
-
|
12
|
+
gem 'capybara-email', '~> 0.1.2'
|
13
|
+
gem 'babosa', '~> 0.3'
|
13
14
|
|
14
15
|
platforms :jruby do
|
15
16
|
gem 'activerecord-jdbcsqlite3-adapter'
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
# Tweets for Refinery CMS
|
1
|
+
# Tweets for Refinery CMS [![Build Status](https://travis-ci.org/cih/refinerycms-tweets.png)](https://travis-ci.org/cih/refinerycms-tweets)
|
2
2
|
|
3
3
|
## About
|
4
4
|
|
5
|
-
Tweets allows you add a Twitter feed to your site in
|
5
|
+
Tweets allows you add a Twitter feed to your site in minuites.
|
6
6
|
|
7
7
|
## Features
|
8
8
|
|
@@ -17,7 +17,9 @@ I do plan to add a vanilla javascript implementation in future but pull requests
|
|
17
17
|
|
18
18
|
Add this line to your application's Gemfile:
|
19
19
|
|
20
|
-
|
20
|
+
```ruby
|
21
|
+
gem 'refinerycms-tweets', '~> 2.1.0'
|
22
|
+
```
|
21
23
|
|
22
24
|
Next run:
|
23
25
|
|
@@ -35,37 +37,41 @@ Just add an account and put the following into your view.
|
|
35
37
|
|
36
38
|
Note: If you do not have a view template already then you will need to override one, here is an example of how to do that.
|
37
39
|
|
38
|
-
rake refinery:override view=refinery/
|
40
|
+
rake refinery:override view=refinery/_footer
|
39
41
|
|
40
42
|
## Configuration
|
41
43
|
|
42
44
|
By default the Twitter widget will be used if the twitter account has a username and widget_id. If there is a username but no widget_id
|
43
45
|
then it will fallback to use the jQuery list. This behaviour can be changed in the initializer as required.
|
44
46
|
|
45
|
-
|
47
|
+
```ruby
|
48
|
+
# config/initializers/refinery/tweets.rb
|
46
49
|
|
47
|
-
|
48
|
-
|
50
|
+
Refinery::Tweets.use_twitter_widget = true
|
51
|
+
Refinery::Tweets.fallback_to_jquery_tweet_list = true
|
52
|
+
```
|
49
53
|
|
50
|
-
|
54
|
+
## Customising
|
51
55
|
|
52
56
|
Just pass in you options as a hash. Here is an example using the twitter widget. You can see a fill list of options in the [docs](https://dev.twitter.com/docs/embedded-timelines#customization)
|
53
57
|
|
54
|
-
|
58
|
+
```erb
|
59
|
+
<%= tweets("data-chrome"=> "noheader", "data-theme" => "dark", :callback => "testalert") %>
|
55
60
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
61
|
+
<%= content_for :javascripts do %>
|
62
|
+
<script>
|
63
|
+
function testalert(response){
|
64
|
+
alert(response);
|
65
|
+
}
|
66
|
+
</script>
|
67
|
+
<% end %>
|
68
|
+
```
|
63
69
|
|
64
70
|
In this case the callback will only be triggered if there is no widget_id.
|
65
71
|
|
66
72
|
## Screenshot
|
67
73
|
|
68
|
-
![Admin view of the Twitter account](http://cih-static.s3.amazonaws.com/refinerycms-tweets-screenshot.png)
|
74
|
+
![Admin view of the Twitter account](http://cih-static.s3.amazonaws.com/blog/refinerycms-tweets-screenshot.png)
|
69
75
|
|
70
76
|
## Testing
|
71
77
|
|
data/Rakefile
CHANGED
data/refinerycms-tweets.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["tochrisholmes@gmail.com"]
|
11
11
|
spec.description = %q{A Refinery CMS engine to add Twitter functionality.}
|
12
12
|
spec.summary = %q{Tweets allows you add a Twitter feed to your site in seconds.}
|
13
|
-
spec.homepage = ""
|
13
|
+
spec.homepage = "https://github.com/cih/refinerycms-tweets"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
@@ -18,6 +18,6 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.
|
22
|
-
spec.
|
21
|
+
spec.add_dependency 'refinerycms-core', '~> 2.1.0'
|
22
|
+
spec.add_dependency 'refinerycms-i18n', '~> 2.1.0'
|
23
23
|
end
|
@@ -3,11 +3,12 @@ require "spec_helper"
|
|
3
3
|
module Refinery
|
4
4
|
module Tweets
|
5
5
|
module Admin
|
6
|
+
|
6
7
|
describe TwitterAccount do
|
7
8
|
refinery_login_with :refinery_user
|
8
9
|
|
9
10
|
let!(:twitter_account) do
|
10
|
-
|
11
|
+
FactoryGirl.create(:twitter_account, :username => "Chris Holmes",
|
11
12
|
:tweet_count => 5,
|
12
13
|
:widget_id => "123456789",
|
13
14
|
:visible => true)
|
@@ -4,17 +4,17 @@ module Refinery
|
|
4
4
|
module Tweets
|
5
5
|
describe TwitterAccount do
|
6
6
|
describe "validations" do
|
7
|
-
subject
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
let(:subject) {
|
8
|
+
FactoryGirl.build(:twitter_account,
|
9
|
+
:username => "twitter",
|
10
|
+
:tweet_count => "5")
|
11
|
+
}
|
12
12
|
|
13
13
|
it { should be_valid }
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
it { expect(subject.errors).to be_empty }
|
15
|
+
it { expect(subject.username).to eq 'twitter' }
|
16
|
+
it { expect(subject.tweet_count).to eq 5 }
|
17
|
+
it { expect(subject.visible).to eq true }
|
18
18
|
end
|
19
19
|
|
20
20
|
describe "account settings" do
|
@@ -52,4 +52,4 @@ module Refinery
|
|
52
52
|
|
53
53
|
end
|
54
54
|
end
|
55
|
-
end
|
55
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -16,6 +16,8 @@ RSpec.configure do |config|
|
|
16
16
|
config.treat_symbols_as_metadata_keys_with_true_values = true
|
17
17
|
config.filter_run :focus => true
|
18
18
|
config.run_all_when_everything_filtered = true
|
19
|
+
config.expose_current_running_example_as :example
|
20
|
+
config.infer_spec_type_from_file_location!
|
19
21
|
end
|
20
22
|
|
21
23
|
# Requires supporting files with custom matchers and macros, etc,
|
metadata
CHANGED
@@ -1,48 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refinerycms-tweets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
5
|
-
prerelease:
|
4
|
+
version: 2.1.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Chris Holmes
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2015-07-31 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
14
|
+
name: refinerycms-core
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
22
|
-
type: :
|
19
|
+
version: 2.1.0
|
20
|
+
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- - ~>
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
26
|
+
version: 2.1.0
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
|
-
name:
|
28
|
+
name: refinerycms-i18n
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - "~>"
|
36
32
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
38
|
-
type: :
|
33
|
+
version: 2.1.0
|
34
|
+
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - "~>"
|
44
39
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
40
|
+
version: 2.1.0
|
46
41
|
description: A Refinery CMS engine to add Twitter functionality.
|
47
42
|
email:
|
48
43
|
- tochrisholmes@gmail.com
|
@@ -50,7 +45,8 @@ executables: []
|
|
50
45
|
extensions: []
|
51
46
|
extra_rdoc_files: []
|
52
47
|
files:
|
53
|
-
- .gitignore
|
48
|
+
- ".gitignore"
|
49
|
+
- ".travis.yml"
|
54
50
|
- Gemfile
|
55
51
|
- LICENSE.txt
|
56
52
|
- README.md
|
@@ -76,37 +72,37 @@ files:
|
|
76
72
|
- licence.md
|
77
73
|
- refinerycms-tweets.gemspec
|
78
74
|
- spec/factories/twitter_account.rb
|
75
|
+
- spec/features/refinery/tweets/admin/tweets_spec.rb
|
79
76
|
- spec/models/refinery/tweets/twitter_account_spec.rb
|
80
|
-
- spec/requests/refinery/tweets/admin/tweets_spec.rb
|
81
77
|
- spec/spec_helper.rb
|
82
78
|
- tasks/rspec.rake
|
83
|
-
homepage:
|
79
|
+
homepage: https://github.com/cih/refinerycms-tweets
|
84
80
|
licenses:
|
85
81
|
- MIT
|
82
|
+
metadata: {}
|
86
83
|
post_install_message:
|
87
84
|
rdoc_options: []
|
88
85
|
require_paths:
|
89
86
|
- lib
|
90
87
|
required_ruby_version: !ruby/object:Gem::Requirement
|
91
|
-
none: false
|
92
88
|
requirements:
|
93
|
-
- -
|
89
|
+
- - ">="
|
94
90
|
- !ruby/object:Gem::Version
|
95
91
|
version: '0'
|
96
92
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
93
|
requirements:
|
99
|
-
- -
|
94
|
+
- - ">="
|
100
95
|
- !ruby/object:Gem::Version
|
101
96
|
version: '0'
|
102
97
|
requirements: []
|
103
98
|
rubyforge_project:
|
104
|
-
rubygems_version:
|
99
|
+
rubygems_version: 2.4.6
|
105
100
|
signing_key:
|
106
|
-
specification_version:
|
101
|
+
specification_version: 4
|
107
102
|
summary: Tweets allows you add a Twitter feed to your site in seconds.
|
108
103
|
test_files:
|
109
104
|
- spec/factories/twitter_account.rb
|
105
|
+
- spec/features/refinery/tweets/admin/tweets_spec.rb
|
110
106
|
- spec/models/refinery/tweets/twitter_account_spec.rb
|
111
|
-
- spec/requests/refinery/tweets/admin/tweets_spec.rb
|
112
107
|
- spec/spec_helper.rb
|
108
|
+
has_rdoc:
|