postmarkdown 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,9 @@
1
+ language: "ruby"
2
+ before_script:
3
+ - "bundle exec rake appraisal:install"
4
+ script: "bundle exec rake appraisal spec"
5
+ rvm:
6
+ - "1.9.3"
7
+ notifications:
8
+ recipients:
9
+ - "dev+travis-ci@ennova.com.au"
data/Appraisals CHANGED
@@ -1,13 +1,9 @@
1
- appraise 'rails3_0' do
2
- gem 'rails', '~> 3.0.0'
3
- end
4
-
5
1
  appraise 'rails3_1' do
6
2
  gem 'rails', '~> 3.1.0'
7
- gem 'combustion', '~> 0.3.1'
3
+ gem 'combustion', '~> 0.4.0'
8
4
  end
9
5
 
10
6
  appraise 'rails3_2' do
11
7
  gem 'rails', '~> 3.2.0'
12
- gem 'combustion', '~> 0.3.1'
8
+ gem 'combustion', '~> 0.4.0'
13
9
  end
data/Gemfile CHANGED
@@ -2,6 +2,5 @@ source 'http://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'ruby-debug19', :require => false
6
5
  gem 'timecop', :require => false
7
6
  gem 'generator_spec', :require => false
@@ -4,6 +4,8 @@ A simple Rails blog engine powered by Markdown.
4
4
 
5
5
  Postmarkdown is compatible with Rails 3 only and the gem is hosted on [RubyGems.org](http://rubygems.org/gems/postmarkdown).
6
6
 
7
+ [![Build Status](https://secure.travis-ci.org/ennova/postmarkdown.png?branch=master)](http://travis-ci.org/ennova/postmarkdown)
8
+
7
9
  ## Features
8
10
 
9
11
  * Markdown files for blog posts
data/Rakefile CHANGED
@@ -7,5 +7,9 @@ require 'rspec/core/rake_task'
7
7
  RSpec::Core::RakeTask.new(:spec)
8
8
 
9
9
  task :default do
10
- exec 'rake appraisal spec'
10
+ if ENV['BUNDLE_GEMFILE'] == File.expand_path('Gemfile')
11
+ exec 'rake appraisal:all'
12
+ else
13
+ Rake::Task['spec'].invoke
14
+ end
11
15
  end
data/app/models/post.rb CHANGED
@@ -88,7 +88,7 @@ class Post
88
88
  file_extensions = Postmarkdown::Config.options[:markdown_file_extensions].join(',')
89
89
  @@posts ||= Dir.glob("#{directory}/*.{#{file_extensions}}").map do |filename|
90
90
  Post.new filename
91
- end.select(&:visible?).sort_by(&:date).reverse
91
+ end.select(&:visible?).sort_by { |post| [post.date, post.slug] }.reverse
92
92
  end
93
93
 
94
94
  def directory
@@ -2,10 +2,9 @@
2
2
 
3
3
  source "http://rubygems.org"
4
4
 
5
- gem "ruby-debug19", :require=>false
6
5
  gem "timecop", :require=>false
7
6
  gem "generator_spec", :require=>false
8
7
  gem "rails", "~> 3.1.0"
9
- gem "combustion", "~> 0.3.1"
8
+ gem "combustion", "~> 0.4.0"
10
9
 
11
10
  gemspec :path=>"../"
@@ -2,10 +2,9 @@
2
2
 
3
3
  source "http://rubygems.org"
4
4
 
5
- gem "ruby-debug19", :require=>false
6
5
  gem "timecop", :require=>false
7
6
  gem "generator_spec", :require=>false
8
7
  gem "rails", "~> 3.2.0"
9
- gem "combustion", "~> 0.3.1"
8
+ gem "combustion", "~> 0.4.0"
10
9
 
11
10
  gemspec :path=>"../"
@@ -5,8 +5,8 @@ module Postmarkdown
5
5
  end
6
6
 
7
7
  def self.git_config(name)
8
- value = `git config --get #{name}`.chomp
9
- value if $?.success?
8
+ value = `git config --get #{name} 2> /dev/null`
9
+ value.chomp if $?.success?
10
10
  end
11
11
  end
12
12
  end
@@ -1,3 +1,3 @@
1
1
  module Postmarkdown
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
data/postmarkdown.gemspec CHANGED
@@ -21,8 +21,8 @@ Gem::Specification.new do |s|
21
21
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
22
22
  s.require_paths = ['lib', 'public']
23
23
 
24
- s.add_dependency 'rails', '~> 3.0'
25
- s.add_dependency 'haml', '~> 3.1'
24
+ s.add_dependency 'rails', '~> 3.1'
25
+ s.add_dependency 'haml', ['>= 3.1', '< 5']
26
26
  s.add_dependency 'gravtastic'
27
27
  s.add_dependency 'nokogiri'
28
28
  s.add_dependency 'rdiscount'
@@ -4,6 +4,5 @@ Rails.application.class.configure do
4
4
  config.consider_all_requests_local = true
5
5
  config.action_controller.perform_caching = false
6
6
  config.action_dispatch.show_exceptions = false
7
- config.action_mailer.delivery_method = :test
8
7
  config.active_support.deprecation = :stderr
9
8
  end
@@ -95,5 +95,17 @@ module Postmarkdown
95
95
  Dir['app/posts/*'].should be_empty
96
96
  end
97
97
  end
98
+
99
+ it 'does not error if git is unavailable' do
100
+ begin
101
+ old_path = ENV['PATH']
102
+ ENV['PATH'] = ''
103
+ expect {
104
+ run_generator %w(test)
105
+ }.to_not raise_error
106
+ ensure
107
+ ENV['PATH'] = old_path
108
+ end
109
+ end
98
110
  end
99
111
  end
data/spec/spec_helper.rb CHANGED
@@ -6,13 +6,8 @@ Bundler.setup :default, :development
6
6
 
7
7
  require 'postmarkdown'
8
8
 
9
- require 'rails/version'
10
- if Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR == 0
11
- require 'support/rails_app/config/environment'
12
- else
13
- require 'combustion'
14
- Combustion.initialize!
15
- end
9
+ require 'combustion'
10
+ Combustion.initialize! :action_controller, :action_view, :sprockets
16
11
 
17
12
  require 'capybara/rspec'
18
13
  require 'rspec/rails'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postmarkdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2012-12-27 00:00:00.000000000 Z
15
+ date: 2013-03-22 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rails
@@ -21,7 +21,7 @@ dependencies:
21
21
  requirements:
22
22
  - - ~>
23
23
  - !ruby/object:Gem::Version
24
- version: '3.0'
24
+ version: '3.1'
25
25
  type: :runtime
26
26
  prerelease: false
27
27
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,23 +29,29 @@ dependencies:
29
29
  requirements:
30
30
  - - ~>
31
31
  - !ruby/object:Gem::Version
32
- version: '3.0'
32
+ version: '3.1'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: haml
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  none: false
37
37
  requirements:
38
- - - ~>
38
+ - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '3.1'
41
+ - - <
42
+ - !ruby/object:Gem::Version
43
+ version: '5'
41
44
  type: :runtime
42
45
  prerelease: false
43
46
  version_requirements: !ruby/object:Gem::Requirement
44
47
  none: false
45
48
  requirements:
46
- - - ~>
49
+ - - ! '>='
47
50
  - !ruby/object:Gem::Version
48
51
  version: '3.1'
52
+ - - <
53
+ - !ruby/object:Gem::Version
54
+ version: '5'
49
55
  - !ruby/object:Gem::Dependency
50
56
  name: gravtastic
51
57
  requirement: !ruby/object:Gem::Requirement
@@ -219,8 +225,10 @@ files:
219
225
  - .gitignore
220
226
  - .rspec
221
227
  - .rvmrc
228
+ - .travis.yml
222
229
  - Appraisals
223
230
  - Gemfile
231
+ - README.markdown
224
232
  - Rakefile
225
233
  - app/controllers/application_controller.rb
226
234
  - app/controllers/posts_controller.rb
@@ -251,7 +259,6 @@ files:
251
259
  - lib/postmarkdown/util.rb
252
260
  - lib/postmarkdown/version.rb
253
261
  - postmarkdown.gemspec
254
- - readme.md
255
262
  - spec/helpers/post_helper_spec.rb
256
263
  - spec/integrations/posts_spec.rb
257
264
  - spec/internal/.gitignore
@@ -283,17 +290,6 @@ files:
283
290
  - spec/support/data/posts/2012-02-13-102030-custom-title-and-timestamp.markdown
284
291
  - spec/support/data/posts/2015-02-13-custom-title.markdown
285
292
  - spec/support/data/posts/missing-date-from-filename.markdown
286
- - spec/support/rails_app/.gitignore
287
- - spec/support/rails_app/app/controllers/application_controller.rb
288
- - spec/support/rails_app/config.ru
289
- - spec/support/rails_app/config/application.rb
290
- - spec/support/rails_app/config/boot.rb
291
- - spec/support/rails_app/config/database.yml
292
- - spec/support/rails_app/config/environment.rb
293
- - spec/support/rails_app/config/initializers/secret_token.rb
294
- - spec/support/rails_app/config/routes.rb
295
- - spec/support/rails_app/db/seeds.rb
296
- - spec/support/rails_app/doc/README_FOR_APP
297
293
  - vendor/assets/stylesheets/postmarkdown/postmarkdown.css
298
294
  homepage: ''
299
295
  licenses:
@@ -311,7 +307,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
311
307
  version: '0'
312
308
  segments:
313
309
  - 0
314
- hash: 62361496562515143
310
+ hash: 3995996797349439592
315
311
  required_rubygems_version: !ruby/object:Gem::Requirement
316
312
  none: false
317
313
  requirements:
@@ -320,7 +316,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
320
316
  version: '0'
321
317
  segments:
322
318
  - 0
323
- hash: 62361496562515143
319
+ hash: 3995996797349439592
324
320
  requirements: []
325
321
  rubyforge_project: postmarkdown
326
322
  rubygems_version: 1.8.24
@@ -359,14 +355,3 @@ test_files:
359
355
  - spec/support/data/posts/2012-02-13-102030-custom-title-and-timestamp.markdown
360
356
  - spec/support/data/posts/2015-02-13-custom-title.markdown
361
357
  - spec/support/data/posts/missing-date-from-filename.markdown
362
- - spec/support/rails_app/.gitignore
363
- - spec/support/rails_app/app/controllers/application_controller.rb
364
- - spec/support/rails_app/config.ru
365
- - spec/support/rails_app/config/application.rb
366
- - spec/support/rails_app/config/boot.rb
367
- - spec/support/rails_app/config/database.yml
368
- - spec/support/rails_app/config/environment.rb
369
- - spec/support/rails_app/config/initializers/secret_token.rb
370
- - spec/support/rails_app/config/routes.rb
371
- - spec/support/rails_app/db/seeds.rb
372
- - spec/support/rails_app/doc/README_FOR_APP
@@ -1,4 +0,0 @@
1
- .bundle
2
- db/*.sqlite3
3
- log/*.log
4
- tmp/
@@ -1,3 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- protect_from_forgery
3
- end
@@ -1,42 +0,0 @@
1
- require File.expand_path('../boot', __FILE__)
2
-
3
- require 'rails/all'
4
-
5
- # If you have a Gemfile, require the gems listed there, including any gems
6
- # you've limited to :test, :development, or :production.
7
- Bundler.require(:default, Rails.env) if defined?(Bundler)
8
-
9
- module RailsApp
10
- class Application < Rails::Application
11
- # Settings in config/environments/* take precedence over those specified here.
12
- # Application configuration should go into files in config/initializers
13
- # -- all .rb files in that directory are automatically loaded.
14
-
15
- # Custom directories with classes and modules you want to be autoloadable.
16
- # config.autoload_paths += %W(#{config.root}/extras)
17
-
18
- # Only load the plugins named here, in the order given (default is alphabetical).
19
- # :all can be used as a placeholder for all plugins not explicitly named.
20
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
21
-
22
- # Activate observers that should always be running.
23
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
24
-
25
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
26
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
27
- # config.time_zone = 'Central Time (US & Canada)'
28
-
29
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
30
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
31
- # config.i18n.default_locale = :de
32
-
33
- # JavaScript files you want as :defaults (application.js is always included).
34
- # config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
35
-
36
- # Configure the default encoding used in templates for Ruby 1.9.
37
- config.encoding = "utf-8"
38
-
39
- # Configure sensitive parameters which will be filtered from the log file.
40
- config.filter_parameters += [:password]
41
- end
42
- end
@@ -1,10 +0,0 @@
1
- require 'rubygems'
2
- gemfile = File.expand_path('../../../../../Gemfile', __FILE__)
3
-
4
- if File.exist?(gemfile)
5
- ENV['BUNDLE_GEMFILE'] = gemfile
6
- require 'bundler'
7
- Bundler.setup
8
- end
9
-
10
- $:.unshift File.expand_path('../../../../../lib', __FILE__)
@@ -1,22 +0,0 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3
3
- development:
4
- adapter: sqlite3
5
- database: db/development.sqlite3
6
- pool: 5
7
- timeout: 5000
8
-
9
- # Warning: The database defined as "test" will be erased and
10
- # re-generated from your development database when you run "rake".
11
- # Do not set this db to the same as development or production.
12
- test:
13
- adapter: sqlite3
14
- database: db/test.sqlite3
15
- pool: 5
16
- timeout: 5000
17
-
18
- production:
19
- adapter: sqlite3
20
- database: db/production.sqlite3
21
- pool: 5
22
- timeout: 5000
@@ -1,5 +0,0 @@
1
- # Load the rails application
2
- require File.expand_path('../application', __FILE__)
3
-
4
- # Initialize the rails application
5
- RailsApp::Application.initialize!
@@ -1,7 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Your secret key for verifying the integrity of signed cookies.
4
- # If you change this key, all old signed cookies will become invalid!
5
- # Make sure the secret is at least 30 characters and all random,
6
- # no regular words or you'll be exposed to dictionary attacks.
7
- RailsApp::Application.config.secret_token = '68e0d835c6a664dca507ac5fd7f0117855bb2f53ded695b1f5136b714a9a3407f227fef3517bbfef38ac2afa18f3cdf975be590a0ba609b636760a4ac5b3f588'
@@ -1,3 +0,0 @@
1
- Rails.application.routes.draw do
2
- postmarkdown
3
- end
@@ -1,4 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path('../config/environment', __FILE__)
4
- run RailsApp::Application
@@ -1,7 +0,0 @@
1
- # This file should contain all the record creation needed to seed the database with its default values.
2
- # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
- #
4
- # Examples:
5
- #
6
- # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
7
- # Mayor.create(:name => 'Daley', :city => cities.first)
@@ -1,2 +0,0 @@
1
- Use this README file to introduce your application and point to useful places in the API for learning more.
2
- Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.