easycomments 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c4e7fb9a16243a48eee3be7cc2437dd33d4a262
4
- data.tar.gz: d0835f6862727a41b739466ef5509b2d576184e0
3
+ metadata.gz: 7167047b3d7e6712e100ad6e3692c94645fb4f5d
4
+ data.tar.gz: 3cef902dde8bd0c7e029964d1a4563c8fda27024
5
5
  SHA512:
6
- metadata.gz: 2b0e68bea14ead823241412ef0d364f10b833f6b62f75609d9f657df6b7fd9fd80da52c7e963502adadc8d25f933c74802fb78ce1b8070a60f3af65a336e17be
7
- data.tar.gz: 20aa83d33f54d3b1bc8646f2188e167867a1f574561e39033ea65a454a77d1aac3148e584801d6209ae45553e65385a5c43b053ef88f2bfd691105d6eb99bba2
6
+ metadata.gz: e07ab076abda884464ebb29eb2b6b44e4d64040b731a5f3bc551bb8b1bd84ee9b39a941727b211760be6be98148f71ecbe68e26b34138a1fd86ab581037d56fb
7
+ data.tar.gz: 2babd846e16e62569b7ed42c5436d88f3cc0f63bee63a06a37eff2f5541ab4c5fd48e681af4a4f6d1e297577c2a06af81d71ff691465945185597e87a9af9008
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.1
4
+ - 2.1.5
5
+ - 2.0.0
data/Gemfile CHANGED
@@ -1,5 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ gem 'rake'
3
4
  gem 'sinatra'
4
5
  gem 'rack-protection'
5
6
  gem 'multi_json'
@@ -7,3 +8,8 @@ gem 'rack-contrib'
7
8
  gem 'sequel'
8
9
  gem 'rack-cors'
9
10
  gem 'bcrypt'
11
+
12
+ group :test, :development do
13
+ gem 'sqlite3'
14
+ gem 'airborne'
15
+ end
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # EasyComments
2
- [![Gem Version](https://badge.fury.io/rb/easycomments.svg)](http://badge.fury.io/rb/easycomments)
2
+ [![Gem Version](https://badge.fury.io/rb/easycomments.svg)](http://badge.fury.io/rb/easycomments)
3
+ [![Build Status](https://travis-ci.org/zisismaras/easycomments.svg?branch=master)](https://travis-ci.org/zisismaras/easycomments)
4
+
3
5
 
4
6
  EasyComments(EC) is an easy to use comment system with a simple api
5
7
  for posting and retrieving comments.It also comes bundled with a dashboard
@@ -21,7 +23,7 @@ bundle install
21
23
  ```
22
24
  and you are ready.
23
25
  ##Configuring
24
- Edit _config.yml and add your database (all adapters supported by sequel can be used)
26
+ Edit _config.yml to add your database (all adapters supported by sequel can be used)
25
27
  and change any other option you need.
26
28
  Then run
27
29
  ```ruby
@@ -88,7 +90,7 @@ It will recopy all the files but keeps your _config.yml and Gemfile.
88
90
  'rake init' creates the required table.
89
91
  'rake update' run it after re-editing _config.yml to update the table.
90
92
  'rake adduser' you should always run this and not adding new users in _config.yml
91
- by hand since it also bcypts your passwords!
93
+ by hand since it also bcrypts your passwords!
92
94
 
93
95
  ##TODO:
94
96
  * pagination in GET /comments
@@ -102,5 +104,10 @@ by hand since it also bcypts your passwords!
102
104
  4. Push to the branch (`git push origin my-new-feature`)
103
105
  5. Create new Pull Request
104
106
 
107
+ ###Tested with
108
+ * Ruby 2.2.1
109
+ * Ruby 2.1.5
110
+ * Ruby 2.0.0
111
+
105
112
  ###Licensed under MIT.
106
113
 
data/Rakefile CHANGED
@@ -1,8 +1,15 @@
1
1
  require "sequel"
2
2
  require 'io/console'
3
3
  require 'bcrypt'
4
+
5
+ require "bundler/gem_tasks"
6
+ require 'rspec/core/rake_task'
7
+
4
8
  require_relative "lib/easycomments/ec_configuration.rb"
5
9
 
10
+ RSpec::Core::RakeTask.new
11
+ task :default => :spec
12
+
6
13
  include Configuration
7
14
 
8
15
  DB = Sequel.connect(CONNECTION)
data/_config.yml CHANGED
@@ -3,7 +3,7 @@ connection: "sqlite://blog.db"
3
3
  approve_by_default: false
4
4
  allow_anonymous_post: false
5
5
  timestamp_format: "%d/%m/%Y - %H:%M"
6
- allow_cors: true
6
+ allow_cors: false
7
7
  cors_origin: "*"
8
8
  auto_escape_html: true
9
9
  :users:
data/bin/ec CHANGED
@@ -17,9 +17,6 @@ def copy_files(local_path, users_path, files, dev=false)
17
17
  if dev
18
18
  FileUtils.cp_r local_path + "/spec", users_path, :verbose => true
19
19
  FileUtils.cp_r local_path + '/.rspec', users_path, :verbose => true
20
- if ARGV[0] == 'install'
21
- FileUtils.cp_r local_path + '/Gemfile.dev', users_path + "/Gemfile", :verbose => true
22
- end
23
20
  end
24
21
  end
25
22
 
data/easycomments.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'easycomments'
3
- s.version = '1.0.2'
4
- s.date = '2015-03-30'
3
+ s.version = '1.0.3'
4
+ s.date = '2015-03-31'
5
5
  s.summary = "Simple and easy to use comment system"
6
6
  s.description = <<EOF
7
7
  EasyComments(EC) is an easy to use comment system with a simple api
data/lib/easycomments.rb CHANGED
@@ -7,7 +7,7 @@ require 'rack/protection'
7
7
  require 'bcrypt'
8
8
  require_relative "easycomments/ec_configuration.rb"
9
9
 
10
- VERSION = "1.0.2"
10
+ VERSION = "1.0.3"
11
11
 
12
12
  include Configuration
13
13
 
@@ -12,7 +12,10 @@ Airborne.configure do |config|
12
12
  $VERBOSE = original_verbosity
13
13
  db_setup
14
14
  end
15
- config.before(:each) {add_new_comment}
15
+ config.before(:each) do
16
+ add_new_comment
17
+ config.rack_app = ECDashboard
18
+ end
16
19
  end
17
20
 
18
21
  describe 'ec_dasboard' do
@@ -23,7 +26,7 @@ describe 'ec_dasboard' do
23
26
 
24
27
  describe "GET /comments" do
25
28
  it "returns the comments successfully" do
26
- get "/comments?post=#{example_post}"
29
+ get "/comments", {:post => example_post}
27
30
  expect_json_types({:comments => :array_of_objects})
28
31
  end
29
32
  end
@@ -47,7 +50,7 @@ describe 'ec_dasboard' do
47
50
  end
48
51
  describe "GET /get_pending_comments" do
49
52
  it "returns the pending comments list for a post successfully" do
50
- get "/get_pending_comments?post=#{example_post}"
53
+ get "/get_pending_comments", {:post => example_post}
51
54
  expect_json_types({:comments => :array_of_objects})
52
55
  end
53
56
  end
@@ -65,7 +68,7 @@ describe 'ec_dasboard' do
65
68
  end
66
69
  describe "POST /change_approval_status" do
67
70
  it "changes the approval status for a comment successfully" do
68
- post "/change_approval_status", {:id => 3}
71
+ post "/change_approval_status", {:id => 1}
69
72
  expect_json({:status => "Approval status successfully changed."})
70
73
  end
71
74
  end
data/spec/ec/ec_spec.rb CHANGED
@@ -24,7 +24,10 @@ Airborne.configure do |config|
24
24
  ALLOW_ANONYMOUS_POST = false
25
25
  $VERBOSE = original_verbosity
26
26
  end
27
- config.before(:each) {add_new_comment}
27
+ config.before(:each) do
28
+ add_new_comment
29
+ config.rack_app = EC
30
+ end
28
31
  end
29
32
 
30
33
  describe 'ec' do
@@ -71,7 +74,7 @@ describe 'ec' do
71
74
  end
72
75
  describe "GET /comments" do
73
76
  it "returns the comments successfully" do
74
- get "/comments?post=#{example_post}"
77
+ get "/comments", {:post => example_post}
75
78
  expect_json_types({:comments => :array_of_objects})
76
79
  end
77
80
  end
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require "airborne"
2
+ require 'sqlite3'
2
3
 
3
4
  require_relative "../ec.rb"
4
5
  require_relative "../dashboard.rb"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easycomments
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zisis Maras
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-30 00:00:00.000000000 Z
11
+ date: 2015-03-31 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  EasyComments(EC) is an easy to use comment system with a simple api
@@ -20,10 +20,10 @@ executables:
20
20
  extensions: []
21
21
  extra_rdoc_files: []
22
22
  files:
23
- - ".gitignore"
24
- - ".rspec"
23
+ - .gitignore
24
+ - .rspec
25
+ - .travis.yml
25
26
  - Gemfile
26
- - Gemfile.dev
27
27
  - LICENSE
28
28
  - README.md
29
29
  - Rakefile
@@ -408,17 +408,17 @@ require_paths:
408
408
  - lib
409
409
  required_ruby_version: !ruby/object:Gem::Requirement
410
410
  requirements:
411
- - - ">="
411
+ - - '>='
412
412
  - !ruby/object:Gem::Version
413
413
  version: '0'
414
414
  required_rubygems_version: !ruby/object:Gem::Requirement
415
415
  requirements:
416
- - - ">="
416
+ - - '>='
417
417
  - !ruby/object:Gem::Version
418
418
  version: '0'
419
419
  requirements: []
420
420
  rubyforge_project:
421
- rubygems_version: 2.4.6
421
+ rubygems_version: 2.4.3
422
422
  signing_key:
423
423
  specification_version: 4
424
424
  summary: Simple and easy to use comment system
data/Gemfile.dev DELETED
@@ -1,14 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'sinatra'
4
- gem 'rack-protection'
5
- gem 'multi_json'
6
- gem 'rack-contrib'
7
- gem 'sequel'
8
- gem 'rack-cors'
9
- gem 'bcrypt'
10
-
11
- group :test, :development do
12
- gem 'sqlite3'
13
- gem 'airborne'
14
- end