jabe 0.5.3 → 0.5.4

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/Gemfile CHANGED
@@ -19,15 +19,14 @@ group :development, :test do
19
19
  gem 'cucumber'
20
20
  gem 'cucumber-rails'
21
21
  gem 'database_cleaner', '>= 0.6.0'
22
- gem 'faker'
23
22
  gem 'jeweler'
24
23
  gem 'launchy'
25
24
  gem 'machinist', '>= 2.0.0.beta2'
26
- gem 'mysql'
27
25
  gem 'pickle'
28
26
  gem 'rcov'
29
27
  gem 'redgreen'
30
28
  gem 'rspec-rails', '2.0.1'
31
29
  gem 'ruby-debug'
30
+ gem 'sqlite3-ruby'
32
31
  gem 'wirble'
33
32
  end
@@ -69,8 +69,6 @@ GEM
69
69
  diff-lcs (1.1.2)
70
70
  erubis (2.6.6)
71
71
  abstract (>= 1.0.0)
72
- faker (0.9.2)
73
- i18n (~> 0.4)
74
72
  ffi (0.6.3)
75
73
  rake (>= 0.8.7)
76
74
  formtastic (1.2.3.beta)
@@ -79,9 +77,8 @@ GEM
79
77
  i18n (>= 0.4.0)
80
78
  friendly_id (3.1.8)
81
79
  babosa (~> 0.2.0)
82
- gherkin (2.3.2)
80
+ gherkin (2.3.3)
83
81
  json (~> 1.4.6)
84
- term-ansicolor (~> 1.0.5)
85
82
  git (1.2.5)
86
83
  haml (3.0.25)
87
84
  haml-rails (0.3.4)
@@ -104,13 +101,12 @@ GEM
104
101
  rake (>= 0.8.1)
105
102
  linecache (0.43)
106
103
  machinist (2.0.0.beta2)
107
- mail (2.2.12)
104
+ mail (2.2.13)
108
105
  activesupport (>= 2.3.6)
109
106
  i18n (>= 0.4.0)
110
107
  mime-types (~> 1.16)
111
108
  treetop (~> 1.4.8)
112
109
  mime-types (1.16)
113
- mysql (2.8.1)
114
110
  nokogiri (1.4.4)
115
111
  pickle (0.4.4)
116
112
  cucumber (>= 0.8)
@@ -157,12 +153,13 @@ GEM
157
153
  ruby-debug-base (0.10.4)
158
154
  linecache (>= 0.3)
159
155
  rubyzip (0.9.4)
160
- sass (3.1.0.alpha.206)
156
+ sass (3.1.0.alpha.210)
161
157
  selenium-webdriver (0.1.2)
162
158
  childprocess (~> 0.1.5)
163
159
  ffi (~> 0.6.3)
164
160
  json_pure
165
161
  rubyzip
162
+ sqlite3-ruby (1.3.2)
166
163
  sys-uname (0.8.5)
167
164
  term-ansicolor (1.0.5)
168
165
  thor (0.14.6)
@@ -190,7 +187,6 @@ DEPENDENCIES
190
187
  cucumber-rails
191
188
  database_cleaner (>= 0.6.0)
192
189
  devise
193
- faker
194
190
  formtastic (>= 1.2.3.beta)
195
191
  friendly_id (= 3.1.8)
196
192
  haml (>= 3.0.23)
@@ -199,7 +195,6 @@ DEPENDENCIES
199
195
  jquery-rails
200
196
  launchy
201
197
  machinist (>= 2.0.0.beta2)
202
- mysql
203
198
  pickle
204
199
  rails (~> 3.0.3)
205
200
  rcov
@@ -207,5 +202,6 @@ DEPENDENCIES
207
202
  rspec-rails (= 2.0.1)
208
203
  ruby-debug
209
204
  sass (>= 3.1.0.alpha.206)
205
+ sqlite3-ruby
210
206
  will_paginate (>= 3.0.pre2)
211
207
  wirble
@@ -12,28 +12,41 @@ h2. Basic TODOs
12
12
  h2. Installing
13
13
 
14
14
  Edit your Gemfile and add the required gems
15
- gem 'rails', '~> 3.0.3'
16
- gem 'devise'
17
- gem 'friendly_id', '3.1.8'
18
- gem 'formtastic', '>= 1.2.3.beta'
19
- gem 'haml', '>= 3.0.23'
20
- gem 'haml-rails'
21
- gem 'jquery-rails'
22
- gem 'RedCloth'
23
- gem 'sass', '>= 3.1.0.alpha.206'
24
- gem 'will_paginate', '>= 3.0.pre2'
15
+
16
+ <pre><code>gem 'devise'
17
+ gem 'friendly_id', '3.1.8'
18
+ gem 'formtastic', '>= 1.2.3.beta'
19
+ gem 'haml', '>= 3.0.23'
20
+ gem 'haml-rails'
21
+ gem 'jabe'
22
+ gem 'jquery-rails'
23
+ gem 'RedCloth'
24
+ gem 'sass', '>= 3.1.0.alpha.206'
25
+ gem 'will_paginate', '>= 3.0.pre2'
26
+ </code></pre>
25
27
 
26
28
  From your rails root
27
29
 
28
- * bundle install
29
- * rails plugin install http://github.com/defunkt/acts_as_textiled.git
30
- * rails g devise:install
31
- * rails g jabe:migrations
32
- * rake db:migrate
33
- * rm app/views/layouts/*
34
- * rm public/index.html
35
- * rails c
36
- * >> Admin.create!(:email => 'you@example.com', :password => 'password', :password_confirmation => 'password')
37
- * rails s
38
- * login
39
- * edit settings
30
+ <pre><code>bundle install
31
+ rails plugin install http://github.com/defunkt/acts_as_textiled.git
32
+ rails g devise:install
33
+ rails g jabe:migrations
34
+ rake db:migrate
35
+ rm app/views/layouts/*
36
+ rm public/index.html
37
+ rails c
38
+ >> Admin.create!(:email => 'you@example.com', :password => 'password', :password_confirmation => 'password')
39
+ rails s
40
+ login
41
+ edit settings
42
+ </code></pre>
43
+
44
+ h2. Deploying on Heroku
45
+
46
+ There are a couple changes you need to make to deploy on Heroku.
47
+
48
+ * In produciton.rb set <code>config.serve_static_assets = true</code>
49
+ * Add an initializer for Sass config/initializers/zz-sass.rb
50
+ <code>Sass::Plugin.options[:never_update] = true</code>
51
+ * Generate the stylesheets
52
+ <code>rails g jabe:stylesheets</code>
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.3
1
+ 0.5.4
@@ -0,0 +1,8 @@
1
+ class FeedController < ApplicationController
2
+ def index
3
+ @entries = Entry.published.paginate(
4
+ :page => (params[:page] || 1),
5
+ :per_page => (SETTINGS.entries_per_page || 5)
6
+ )
7
+ end
8
+ end
@@ -0,0 +1,12 @@
1
+ atom_feed do |feed|
2
+ feed.title(SETTINGS.site_name)
3
+
4
+ feed.updated @entries.first.try(:published_at)
5
+
6
+ @entries.each do |post|
7
+ feed.entry(post) do |entry|
8
+ entry.title h post.title
9
+ entry.body strip_tags post.body
10
+ end
11
+ end
12
+ end
@@ -1,7 +1,10 @@
1
- Rails::Application.routes.draw do
1
+ Rails.application.routes.draw do
2
2
 
3
3
  root :to => "entries#index"
4
4
 
5
+ match 'feed' => 'feed#index', :format => :xml, :as => 'feed'
6
+ match 'feed/atom.xml' => 'feed#index'
7
+
5
8
  resources :entries do
6
9
  resources :comments
7
10
  end
@@ -41,5 +41,12 @@ module Dummy
41
41
 
42
42
  # Configure sensitive parameters which will be filtered from the log file.
43
43
  config.filter_parameters += [:password]
44
+
45
+ config.generators do |g|
46
+ g.template_engine :haml
47
+ g.test_framework :rspec, :fixture => false, :views => false, :view_specs => false
48
+ g.fixture_replacement :machinist
49
+ end
50
+
44
51
  end
45
52
  end
@@ -2,6 +2,12 @@ Given /^a published entry$/ do
2
2
  Entry.make!(:published)
3
3
  end
4
4
 
5
+ Given /^(\d+) entries$/ do |count|
6
+ count.to_i.times do
7
+ Entry.make!
8
+ end
9
+ end
10
+
5
11
  Then /^the entry should be a draft$/ do
6
12
  entry = @entry || Entry.last
7
13
  entry.draft.should be_true
@@ -33,3 +39,16 @@ Then /^the entry should have (\d+) comments?$/ do |count|
33
39
  entry = @entry || Entry.last
34
40
  entry.comments.count.should eql(count.to_i)
35
41
  end
42
+
43
+ Then /^I should see the entries in the feed$/ do
44
+ doc = Nokogiri::XML(page.body)
45
+ entries = doc.css('entry')
46
+
47
+ Entry.published.paginate(
48
+ :page => 1,
49
+ :per_page => (SETTINGS.entries_per_page || 5)
50
+ ).each_with_index do |entry, idx|
51
+ entries[idx].css('title').text.should eql(entry.title)
52
+ entries[idx].css('body').text.should eql(entry.body(:source))
53
+ end
54
+ end
@@ -17,9 +17,10 @@ Settings.blueprint do
17
17
  end
18
18
 
19
19
  Entry.blueprint do
20
- title { Faker::Lorem.words.to_s }
21
- body { Faker::Lorem.paragraph }
20
+ title { 'My awesome blog entry' }
21
+ body { 'This is the body of my awesome blog entry' }
22
22
  published_at { Time.now }
23
+ draft { false }
23
24
  end
24
25
 
25
26
  Entry.blueprint(:published) do
@@ -14,6 +14,8 @@ module NavigationHelpers
14
14
  admin_root_path
15
15
  when 'the entry page'
16
16
  entry_path(Entry.last)
17
+ when 'the feed url'
18
+ feed_path
17
19
 
18
20
  # Add more mappings here.
19
21
  # Here is an example that pulls values out of the Regexp:
File without changes
@@ -0,0 +1,9 @@
1
+ require 'machinist/active_record'
2
+
3
+ # Add your blueprints here.
4
+ #
5
+ # e.g.
6
+ # Post.blueprint do
7
+ # title { "Post #{sn}" }
8
+ # body { "Lorem ipsum..." }
9
+ # end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jabe
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 3
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 3
10
- version: 0.5.3
9
+ - 4
10
+ version: 0.5.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Moen a.k.a. UnderpantsGnome
@@ -277,7 +277,7 @@ dependencies:
277
277
  - !ruby/object:Gem::Dependency
278
278
  prerelease: false
279
279
  type: :development
280
- name: faker
280
+ name: jeweler
281
281
  version_requirements: &id018 !ruby/object:Gem::Requirement
282
282
  none: false
283
283
  requirements:
@@ -291,7 +291,7 @@ dependencies:
291
291
  - !ruby/object:Gem::Dependency
292
292
  prerelease: false
293
293
  type: :development
294
- name: jeweler
294
+ name: launchy
295
295
  version_requirements: &id019 !ruby/object:Gem::Requirement
296
296
  none: false
297
297
  requirements:
@@ -305,38 +305,38 @@ dependencies:
305
305
  - !ruby/object:Gem::Dependency
306
306
  prerelease: false
307
307
  type: :development
308
- name: launchy
308
+ name: machinist
309
309
  version_requirements: &id020 !ruby/object:Gem::Requirement
310
310
  none: false
311
311
  requirements:
312
312
  - - ">="
313
313
  - !ruby/object:Gem::Version
314
- hash: 3
314
+ hash: -1848230038
315
315
  segments:
316
+ - 2
316
317
  - 0
317
- version: "0"
318
+ - 0
319
+ - beta2
320
+ version: 2.0.0.beta2
318
321
  requirement: *id020
319
322
  - !ruby/object:Gem::Dependency
320
323
  prerelease: false
321
324
  type: :development
322
- name: machinist
325
+ name: pickle
323
326
  version_requirements: &id021 !ruby/object:Gem::Requirement
324
327
  none: false
325
328
  requirements:
326
329
  - - ">="
327
330
  - !ruby/object:Gem::Version
328
- hash: -1848230038
331
+ hash: 3
329
332
  segments:
330
- - 2
331
333
  - 0
332
- - 0
333
- - beta2
334
- version: 2.0.0.beta2
334
+ version: "0"
335
335
  requirement: *id021
336
336
  - !ruby/object:Gem::Dependency
337
337
  prerelease: false
338
338
  type: :development
339
- name: mysql
339
+ name: rcov
340
340
  version_requirements: &id022 !ruby/object:Gem::Requirement
341
341
  none: false
342
342
  requirements:
@@ -350,7 +350,7 @@ dependencies:
350
350
  - !ruby/object:Gem::Dependency
351
351
  prerelease: false
352
352
  type: :development
353
- name: pickle
353
+ name: redgreen
354
354
  version_requirements: &id023 !ruby/object:Gem::Requirement
355
355
  none: false
356
356
  requirements:
@@ -364,21 +364,23 @@ dependencies:
364
364
  - !ruby/object:Gem::Dependency
365
365
  prerelease: false
366
366
  type: :development
367
- name: rcov
367
+ name: rspec-rails
368
368
  version_requirements: &id024 !ruby/object:Gem::Requirement
369
369
  none: false
370
370
  requirements:
371
- - - ">="
371
+ - - "="
372
372
  - !ruby/object:Gem::Version
373
- hash: 3
373
+ hash: 13
374
374
  segments:
375
+ - 2
375
376
  - 0
376
- version: "0"
377
+ - 1
378
+ version: 2.0.1
377
379
  requirement: *id024
378
380
  - !ruby/object:Gem::Dependency
379
381
  prerelease: false
380
382
  type: :development
381
- name: redgreen
383
+ name: ruby-debug
382
384
  version_requirements: &id025 !ruby/object:Gem::Requirement
383
385
  none: false
384
386
  requirements:
@@ -392,24 +394,8 @@ dependencies:
392
394
  - !ruby/object:Gem::Dependency
393
395
  prerelease: false
394
396
  type: :development
395
- name: rspec-rails
397
+ name: sqlite3-ruby
396
398
  version_requirements: &id026 !ruby/object:Gem::Requirement
397
- none: false
398
- requirements:
399
- - - "="
400
- - !ruby/object:Gem::Version
401
- hash: 13
402
- segments:
403
- - 2
404
- - 0
405
- - 1
406
- version: 2.0.1
407
- requirement: *id026
408
- - !ruby/object:Gem::Dependency
409
- prerelease: false
410
- type: :development
411
- name: ruby-debug
412
- version_requirements: &id027 !ruby/object:Gem::Requirement
413
399
  none: false
414
400
  requirements:
415
401
  - - ">="
@@ -418,12 +404,12 @@ dependencies:
418
404
  segments:
419
405
  - 0
420
406
  version: "0"
421
- requirement: *id027
407
+ requirement: *id026
422
408
  - !ruby/object:Gem::Dependency
423
409
  prerelease: false
424
410
  type: :development
425
411
  name: wirble
426
- version_requirements: &id028 !ruby/object:Gem::Requirement
412
+ version_requirements: &id027 !ruby/object:Gem::Requirement
427
413
  none: false
428
414
  requirements:
429
415
  - - ">="
@@ -432,7 +418,7 @@ dependencies:
432
418
  segments:
433
419
  - 0
434
420
  version: "0"
435
- requirement: *id028
421
+ requirement: *id027
436
422
  description: Blog engine for Rails 3+
437
423
  email: michael@pixels-and-bits.com
438
424
  executables: []
@@ -454,6 +440,7 @@ files:
454
440
  - app/controllers/admin/settings_controller.rb
455
441
  - app/controllers/comments_controller.rb
456
442
  - app/controllers/entries_controller.rb
443
+ - app/controllers/feed_controller.rb
457
444
  - app/helpers/jabe_helper.rb
458
445
  - app/models/admin.rb
459
446
  - app/models/comment.rb
@@ -473,6 +460,7 @@ files:
473
460
  - app/views/entries/_comment_form.html.haml
474
461
  - app/views/entries/index.html.haml
475
462
  - app/views/entries/show.html.haml
463
+ - app/views/feed/index.xml.builder
476
464
  - app/views/layouts/_footer.html.haml
477
465
  - app/views/layouts/_header.html.haml
478
466
  - app/views/layouts/_sidebar.html.haml
@@ -512,15 +500,6 @@ files:
512
500
  - public/javascripts/rails.js
513
501
  - public/nginx.conf
514
502
  - public/robots.txt
515
- - features/admin.feature
516
- - features/entries.feature
517
- - features/step_definitions/admin_steps.rb
518
- - features/step_definitions/entry_steps.rb
519
- - features/step_definitions/support_steps.rb
520
- - features/step_definitions/web_steps.rb
521
- - features/support/blueprints.rb
522
- - features/support/env.rb
523
- - features/support/paths.rb
524
503
  - spec/support/blueprints.rb
525
504
  - test/dummy/app/controllers/application_controller.rb
526
505
  - test/dummy/app/helpers/application_helper.rb
@@ -543,6 +522,15 @@ files:
543
522
  - test/dummy/db/migrate/20101229224030_create_entries.rb
544
523
  - test/dummy/db/migrate/20101229224031_create_comments.rb
545
524
  - test/dummy/db/schema.rb
525
+ - test/dummy/features/step_definitions/admin_steps.rb
526
+ - test/dummy/features/step_definitions/entry_steps.rb
527
+ - test/dummy/features/step_definitions/support_steps.rb
528
+ - test/dummy/features/step_definitions/web_steps.rb
529
+ - test/dummy/features/support/blueprints.rb
530
+ - test/dummy/features/support/env.rb
531
+ - test/dummy/features/support/paths.rb
532
+ - test/dummy/spec/spec_helper.rb
533
+ - test/dummy/spec/support/blueprints.rb
546
534
  - test/dummy/vendor/plugins/acts_as_textiled/init.rb
547
535
  - test/dummy/vendor/plugins/acts_as_textiled/lib/acts_as_textiled.rb
548
536
  - test/dummy/vendor/plugins/acts_as_textiled/test/fixtures/author.rb
@@ -584,15 +572,6 @@ signing_key:
584
572
  specification_version: 3
585
573
  summary: Just Another Blog Engine
586
574
  test_files:
587
- - features/admin.feature
588
- - features/entries.feature
589
- - features/step_definitions/admin_steps.rb
590
- - features/step_definitions/entry_steps.rb
591
- - features/step_definitions/support_steps.rb
592
- - features/step_definitions/web_steps.rb
593
- - features/support/blueprints.rb
594
- - features/support/env.rb
595
- - features/support/paths.rb
596
575
  - spec/support/blueprints.rb
597
576
  - test/dummy/app/controllers/application_controller.rb
598
577
  - test/dummy/app/helpers/application_helper.rb
@@ -615,6 +594,15 @@ test_files:
615
594
  - test/dummy/db/migrate/20101229224030_create_entries.rb
616
595
  - test/dummy/db/migrate/20101229224031_create_comments.rb
617
596
  - test/dummy/db/schema.rb
597
+ - test/dummy/features/step_definitions/admin_steps.rb
598
+ - test/dummy/features/step_definitions/entry_steps.rb
599
+ - test/dummy/features/step_definitions/support_steps.rb
600
+ - test/dummy/features/step_definitions/web_steps.rb
601
+ - test/dummy/features/support/blueprints.rb
602
+ - test/dummy/features/support/env.rb
603
+ - test/dummy/features/support/paths.rb
604
+ - test/dummy/spec/spec_helper.rb
605
+ - test/dummy/spec/support/blueprints.rb
618
606
  - test/dummy/vendor/plugins/acts_as_textiled/init.rb
619
607
  - test/dummy/vendor/plugins/acts_as_textiled/lib/acts_as_textiled.rb
620
608
  - test/dummy/vendor/plugins/acts_as_textiled/test/fixtures/author.rb
@@ -1,30 +0,0 @@
1
- Feature: Site management
2
-
3
- Background:
4
- Given a logged in admin
5
-
6
- Scenario: An admin edits the site settings
7
- When I follow "Settings"
8
- And I fill in "settings_site_name" with "Pixels and Bits"
9
- And I press "Save"
10
- Then I should see "Pixels and Bits"
11
-
12
- Scenario: An admin wants to add a new entry as a draft, then publish
13
- When I follow "Entries"
14
- And I follow "Start a new entry"
15
- And I fill in "entry_title" with "Is this thing on"
16
- And I fill in "entry_body" with "Hrm, Who knows"
17
- And I press "Save as draft"
18
- Then the entry should be a draft
19
- When I go to the home page
20
- Then I should not see the entry
21
- When I follow "Logout"
22
- And I go to the entry page
23
- Then the response should be a 404
24
- Given a logged in admin
25
- And I go to the admin home page
26
- And I follow "Entries"
27
- And I follow the title of the entry
28
- And I press "Publish"
29
- And I go to the home page
30
- Then I should see the entry
@@ -1,24 +0,0 @@
1
- Feature: Interacting with entries
2
-
3
- Background:
4
- Given a published entry
5
- When I am on the home page
6
- And I follow the title of the entry
7
- Then I should see the entry
8
-
9
- Scenario: A human submits a comment
10
- When I fill in "comment_name" with "Michael"
11
- And I fill in "comment_email" with "michael@example.com"
12
- And I fill in "comment_body" with "Cool post"
13
- And I press "Add comment"
14
- Then I should see "Michael"
15
- And I should see "Cool post"
16
- And the entry should have 1 comment
17
-
18
- Scenario: A bot submits a comment
19
- When I fill in "comment_name" with "v1@gr@"
20
- And I fill in "comment_nickname" with "blue pill"
21
- And I fill in "comment_email" with "spambot@example.com"
22
- And I fill in "comment_body" with "take the blue pill"
23
- And I press "Add comment"
24
- Then the entry should have 0 comments