ecrire 0.27.0 → 0.28.0

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.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -0
  3. data/Rakefile +47 -12
  4. data/lib/ecrire/application.rb +30 -7
  5. data/lib/ecrire/config/environment/production.rb +2 -1
  6. data/lib/ecrire/db/migrate/20131111222709_create_posts.rb +1 -1
  7. data/lib/ecrire/db/migrate/20131113200949_create_users.rb +1 -1
  8. data/lib/ecrire/db/migrate/20131221195338_create_partials.rb +1 -1
  9. data/lib/ecrire/db/migrate/20140115215122_create_images.rb +1 -1
  10. data/lib/ecrire/db/migrate/20140617224837_create_labels.rb +1 -1
  11. data/lib/ecrire/db/migrate/20150318549479_create_tags.rb +1 -1
  12. data/lib/ecrire/theme/template/secrets.yml +11 -0
  13. data/lib/ecrire/version.rb +1 -1
  14. data/test/configuration/postgresql/user.rb +50 -0
  15. data/test/configuration/postgresql.rb +43 -0
  16. data/test/configuration.rb +10 -0
  17. data/test/editor/controllers/posts_controller_test.rb +0 -1
  18. data/test/editor/controllers/sessions_controller_test.rb +0 -1
  19. data/test/editor/controllers/tags_controller_test.rb +0 -1
  20. data/test/editor/helpers/base_helper_test.rb +0 -2
  21. data/test/editor/initializers.rb +23 -0
  22. data/test/editor/models/image_test.rb +0 -1
  23. data/test/editor/models/post_test.rb +0 -1
  24. data/test/editor/models/title_test.rb +0 -1
  25. data/test/editor/models/user_test.rb +0 -1
  26. data/test/onboarding/controllers/databases_controller_test.rb +1 -1
  27. data/test/onboarding/controllers/users_controller_test.rb +1 -1
  28. data/test/onboarding/initializers.rb +10 -0
  29. data/test/{editor/theme/secrets.yml → secrets.yml} +2 -2
  30. data/test/{test_task.rb → task.rb} +11 -5
  31. data/test/test_helper.rb +1 -10
  32. data/test/theme/initializers.rb +22 -0
  33. metadata +29 -24
  34. data/test/editor/test_helper.rb +0 -34
  35. data/test/theme/theme/secrets.yml +0 -8
  36. /data/lib/ecrire/app/assets/stylesheets/admin/{base.css.scss → base.scss} +0 -0
  37. /data/lib/ecrire/app/assets/stylesheets/admin/{documentation.css.scss → documentation.scss} +0 -0
  38. /data/lib/ecrire/app/assets/stylesheets/admin/{header.css.scss → header.scss} +0 -0
  39. /data/lib/ecrire/app/assets/stylesheets/admin/{help.css.scss → help.scss} +0 -0
  40. /data/lib/ecrire/app/assets/stylesheets/admin/{images.css.scss → images.scss} +0 -0
  41. /data/lib/ecrire/app/assets/stylesheets/admin/{navigation.css.scss → navigation.scss} +0 -0
  42. /data/lib/ecrire/app/assets/stylesheets/admin/{posts.css.scss → posts.scss} +0 -0
  43. /data/lib/ecrire/app/assets/stylesheets/admin/{save.css.scss → save.scss} +0 -0
  44. /data/lib/ecrire/app/assets/stylesheets/admin/{tags.css.scss → tags.scss} +0 -0
  45. /data/lib/ecrire/app/assets/stylesheets/admin/{title.css.scss → title.scss} +0 -0
  46. /data/lib/ecrire/app/assets/stylesheets/{admin.css.scss → admin.scss} +0 -0
  47. /data/lib/ecrire/app/assets/stylesheets/{ecrire.css.scss → ecrire.scss} +0 -0
  48. /data/lib/ecrire/app/assets/stylesheets/editor/{code.css.scss → code.scss} +0 -0
  49. /data/lib/ecrire/app/assets/stylesheets/editor/{content.css.scss → content.scss} +0 -0
  50. /data/lib/ecrire/app/assets/stylesheets/editor/{figure.css.scss → figure.scss} +0 -0
  51. /data/lib/ecrire/app/assets/stylesheets/{sessions.css.scss → sessions.scss} +0 -0
  52. /data/lib/ecrire/app/assets/stylesheets/shared/{popup.css.scss → popup.scss} +0 -0
  53. /data/lib/ecrire/app/assets/stylesheets/{variables.css.scss → variables.scss} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6ba5385d6716080f7627c1fca5a2a6402f86a0d3
4
- data.tar.gz: 8da73ff93cd99d67cce527fe12e826a19bdceb12
3
+ metadata.gz: 5c710a91a9c520fde98fb9a8a49b0ecff109dc0a
4
+ data.tar.gz: cb48d989c3288a2c51715e645a287751059f9852
5
5
  SHA512:
6
- metadata.gz: dfe75295b9fd1430d0d5a6e35486c0f928c81f695da95dac37810386daa8db00a7077e88de1c6e0495ffa707d159f1bda1783dc1b9b6e76a759455c749fc6ed2
7
- data.tar.gz: 89a2986375f70b026f629647ac4a2f8fa84400c37432bc4fe97fb9c48ef475753cc9d2d321ead18b634638001f2adaa1599d2d3067af3a17ce770bbcbda58748
6
+ metadata.gz: cc8f48e37fdddc4febb2ac9aafff96429cb9ebca88d7b9c527a5ef2e49891d4035b1c3f87a5035e26e5050a89f32cddb2fb533411d89788dc33fa3f021c9284b
7
+ data.tar.gz: fceca5ade5a602ed7710b8bcb1a148889ae4d09e2a151418b867139bda530936fbbadf5d48c2b4f6e28740d760f9d2eaa00ed5d7fd63701f0989ad68f28c713f
data/.travis.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  language: ruby
2
+ sudo: false
2
3
  rvm:
3
4
  2.1.0
4
5
 
data/Rakefile CHANGED
@@ -3,28 +3,69 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
  ENV['RAILS_ENV'] ||= 'test'
4
4
 
5
5
  require 'ecrire'
6
- require_relative 'test/test_task'
6
+ require_relative 'test/configuration'
7
+ require_relative 'test/task'
7
8
 
8
9
  task default: :test
9
10
 
10
11
  namespace :database do
12
+ secrets = YAML.load_file(File.expand_path('../test/secrets.yml', __FILE__))
13
+ info = secrets[ENV['RAILS_ENV']]
14
+ postgresql = Ecrire::Test::Configuration::Postgresql.new(info['database'], info['username'])
11
15
 
12
- task :purge do
13
- [User, Post, Image, Partial, Title].each(&:delete_all)
16
+ task :initialize do
17
+ begin
18
+ unless postgresql.configured?
19
+ puts "It seems you are running the development tests for the first time."
20
+ puts "Ecrire will try to configure postgresql for you..."
21
+
22
+ data = YAML.load_file(File.expand_path('../test/secrets.yml', __FILE__))
23
+
24
+ if postgresql.user.new?
25
+ postgresql.create_user!
26
+ end
27
+
28
+ if !postgresql.user.superuser?
29
+ postgresql.user.superuser!
30
+ end
31
+
32
+ if !postgresql.user.login?
33
+ postgresql.user.login!
34
+ end
35
+
36
+ puts "Done configuring postgresql."
37
+ end
38
+
39
+ postgresql.reset_database!
40
+ rescue Ecrire::Test::Configuration::Error => e
41
+ puts "Ecrire couldn't configure postgresql."
42
+ puts "=> #{e.message}"
43
+ puts "To fix this issue, make sure you have a superuser for #{%x(whoami)}"
44
+ puts "createuser -l -s postgres"
45
+ exit
46
+ end
14
47
  end
15
48
 
16
49
  end
17
50
 
18
51
  namespace :test do
19
- ['markdown', 'editor', 'onboarding', 'theme'].each do |name|
20
- task = Ecrire::TestTask.new(name) do |t|
21
- t.theme = Dir.pwd + "/test/#{name}/theme"
52
+ ['editor', 'onboarding', 'theme'].each do |name|
53
+ Ecrire::Test::Task.new(name) do |t|
54
+ t.before do
55
+ Rake::Task['database:initialize'].invoke
56
+ end
22
57
  t.libs << "test"
23
58
  t.test_files = FileList["test/#{name}/**/*_test.rb"]
24
59
  t.verbose = true
25
60
  end
26
61
  end
27
62
 
63
+ Rake::TestTask.new 'markdown' do |t|
64
+ t.libs << "test"
65
+ t.test_files = FileList["test/markdown/**/*_test.rb"]
66
+ t.verbose = true
67
+ end
68
+
28
69
  end
29
70
 
30
71
  task :test do
@@ -32,9 +73,3 @@ task :test do
32
73
  Rake::Task[name].invoke
33
74
  end
34
75
  end
35
-
36
- at_exit do
37
- unless Ecrire::Application.onboarding?
38
- Rake::Task['database:purge'].invoke
39
- end
40
- end
@@ -26,16 +26,32 @@ module Ecrire
26
26
 
27
27
  alias :require_environment! :initialize!
28
28
 
29
- initializer 'ecrire.secrets', before: :bootstrap_hook do |app|
30
- app.paths.add 'config/secrets', with: Dir.pwd + '/secrets.yml'
29
+ config.before_initialize do
30
+ if paths['config/database'].existent.any?
31
+ require 'ecrire/theme/engine'
32
+ else
33
+ require 'ecrire/onboarding/engine'
34
+ end
31
35
  end
32
36
 
33
- Rails.application.paths.add 'config/database', with: Dir.pwd + '/secrets.yml'
37
+ ##
38
+ # There seems to be a crack between when the configuration
39
+ # is loaded and when the initializer collection is built.
40
+ #
41
+ # Ecrire requires the configuration to be loaded before
42
+ # knowing which module it should load based on the current
43
+ # configuration.
44
+ #
45
+ # For that reason, this method is overloaded.
46
+ #
47
+ def initialize!(group=:default) #:nodoc:
48
+ raise "Application has been already initialized." if @initialized
34
49
 
35
- if File.exist?(Dir.pwd + '/secrets.yml')
36
- require 'ecrire/theme/engine'
37
- else
38
- require 'ecrire/onboarding/engine'
50
+ ActiveSupport.run_load_hooks(:before_initialize, self)
51
+
52
+ run_initializers(group, self)
53
+ @initialized = true
54
+ self
39
55
  end
40
56
 
41
57
  ##
@@ -48,6 +64,8 @@ module Ecrire
48
64
  def paths
49
65
  @paths ||= begin
50
66
  paths = super
67
+ paths.add 'config/secrets', with: Dir.pwd + '/secrets.yml'
68
+ paths.add 'config/database', with: Dir.pwd + '/secrets.yml'
51
69
  paths.add 'config/routes.rb', with: 'routes.rb'
52
70
  paths.add 'config/locales', with: 'locales', glob: "**/*.{rb,yml}"
53
71
  paths
@@ -62,5 +80,10 @@ module Ecrire
62
80
  defined?(Ecrire::Onboarding::Engine)
63
81
  end
64
82
 
83
+ Rails::Application::Bootstrap.initializers.select do |initializer|
84
+ initializer.name.eql? :bootstrap_hook
85
+ end.first.instance_variable_set :@block, Proc.new {}
86
+
65
87
  end
88
+
66
89
  end
@@ -1,7 +1,8 @@
1
1
  Ecrire::Application.configure do
2
2
  config.assets.js_compressor = :uglifier
3
3
  config.assets.debug = false
4
- config.assets.compile = true
4
+ config.assets.compress = true
5
+ config.assets.compile = false
5
6
  config.assets.digest = true
6
7
  config.assets.version = '1.0'
7
8
 
@@ -8,7 +8,7 @@ class CreatePosts < ActiveRecord::Migration
8
8
  t.text :stylesheet
9
9
 
10
10
  t.datetime :published_at
11
- t.timestamps
11
+ t.timestamps null: false
12
12
 
13
13
  end
14
14
  add_index :posts, :title, unique: true
@@ -4,7 +4,7 @@ class CreateUsers < ActiveRecord::Migration
4
4
 
5
5
  t.string :email, null: false
6
6
  t.string :encrypted_password, null: false
7
- t.timestamps
7
+ t.timestamps null: false
8
8
  end
9
9
 
10
10
  add_index :users, :email, unique: true
@@ -2,7 +2,7 @@ class CreatePartials < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :partials do |t|
4
4
 
5
- t.timestamps
5
+ t.timestamps null: false
6
6
  t.string :title, null: false
7
7
  t.text :content
8
8
  t.text :stylesheet
@@ -6,7 +6,7 @@ class CreateImages < ActiveRecord::Migration
6
6
 
7
7
  t.references :post
8
8
 
9
- t.timestamps
9
+ t.timestamps null: false
10
10
  end
11
11
  end
12
12
  end
@@ -3,7 +3,7 @@ class CreateLabels < ActiveRecord::Migration
3
3
  create_table :labels do |t|
4
4
 
5
5
  t.string :name, null: false
6
- t.timestamps
6
+ t.timestamps null: false
7
7
 
8
8
  end
9
9
  add_index :labels, :name, unique: false
@@ -3,7 +3,7 @@ class CreateTags < ActiveRecord::Migration
3
3
  create_table :tags do |t|
4
4
 
5
5
  t.string :name, null: false
6
- t.timestamps
6
+ t.timestamps null: false
7
7
  end
8
8
 
9
9
  add_index :tags, :name, unique: true
@@ -0,0 +1,11 @@
1
+ ---
2
+ development: &1
3
+ adapter: postgresql
4
+ database: ecrire
5
+ user: postgres
6
+ password: a69164528b8b6622e730f722c5d88386
7
+ encoding: utf8
8
+ secret_key: 7681ee4652c6f230cfdb96127826c438
9
+ secret_key_base: 7681ee4652c6f230cfdb96127826c438
10
+ test: *1
11
+ production: *1
@@ -1,3 +1,3 @@
1
1
  module Ecrire
2
- VERSION = '0.27.0'
2
+ VERSION = '0.28.0'
3
3
  end
@@ -0,0 +1,50 @@
1
+ class Ecrire::Test::Configuration::Postgresql::User
2
+ attr_reader :name
3
+
4
+ def initialize(name)
5
+ @name = name
6
+ output = %x(psql -c "select rolname, rolsuper, rolcanlogin from pg_roles where rolname = '#{name}';" -U postgres -d postgres -t -A 2>&1)
7
+
8
+ if $?.to_i != 0 || output.blank?
9
+ @exists = false
10
+ return
11
+ end
12
+
13
+ @exists = true
14
+ row = output.chomp.split('|')
15
+
16
+ @name = row[0]
17
+ @superuser = row[1] == 't'
18
+ @login = row[2] == 't'
19
+ end
20
+
21
+ def new?
22
+ !@exists
23
+ end
24
+
25
+ def superuser?
26
+ @superuser
27
+ end
28
+
29
+ def login?
30
+ @login
31
+ end
32
+
33
+ def superuser!
34
+ puts "Making #{@name} a superuser..."
35
+ message = %x(psql -c "alter role #{@name} with superuser" -U postgres -d postgres 2>&1)
36
+ if $?.to_i != 0
37
+ raise Ecrire::Test::Configuration::Postgresql::PSQLError.new message
38
+ end
39
+ puts "#{@name} is a superuser."
40
+ end
41
+
42
+ def login!
43
+ puts "Making #{@name} loggable..."
44
+ message = %x(psql -c "alter role #{@name} with login" -U postgres -d postgres 2>&1)
45
+ if $?.to_i != 0
46
+ raise Ecrire::Test::Configuration::Postgresql::PSQLError.new message
47
+ end
48
+ puts "#{@name} can log in."
49
+ end
50
+ end
@@ -0,0 +1,43 @@
1
+ class Ecrire::Test::Configuration::Postgresql
2
+ class PSQLError < Ecrire::Test::Configuration::Error; end;
3
+ require_relative 'postgresql/user'
4
+
5
+ attr_reader :user
6
+
7
+ def initialize(database, user)
8
+ @database = database
9
+ @user = User.new(user)
10
+ end
11
+
12
+ def configured?
13
+ %x(psql -c '' -d #{@database} -U #{@user.name} 2>&1)
14
+ if $?.to_i != 0
15
+ return false
16
+ end
17
+ return true
18
+ end
19
+
20
+ def create_user!
21
+ puts "Creating user #{@user.name}..."
22
+ message = %x(psql -c 'CREATE ROLE #{@user.name} with superuser login' -d postgres -U postgres 2>&1)
23
+ if $?.to_i != 0
24
+ raise PSQLError.new message
25
+ end
26
+ @user= User.new(@user.name)
27
+ puts "User #{@user.name} created."
28
+ end
29
+
30
+ def reset_database!(silence = false)
31
+ unless silence
32
+ puts "Resetting #{@database} if it exists..."
33
+ end
34
+
35
+ ActiveRecord::Tasks::DatabaseTasks.drop({'adapter' => 'postgresql', 'database' => @database, 'user' => user.name})
36
+ ActiveRecord::Tasks::DatabaseTasks.create({'adapter' => 'postgresql', 'database' => @database, 'user' => user.name})
37
+
38
+ unless silence
39
+ puts "#{@database} configured."
40
+ end
41
+ end
42
+
43
+ end
@@ -0,0 +1,10 @@
1
+ module Ecrire
2
+ module Test
3
+ module Configuration
4
+ class Error < StandardError
5
+ end
6
+
7
+ require_relative 'configuration/postgresql'
8
+ end
9
+ end
10
+ end
@@ -1,5 +1,4 @@
1
1
  require 'test_controller'
2
- require 'editor/test_helper'
3
2
 
4
3
  class PostsControllerTest < TestController
5
4
  tests Admin::PostsController
@@ -1,5 +1,4 @@
1
1
  require 'test_controller'
2
- require 'editor/test_helper'
3
2
 
4
3
  class SessionsControllerTest < TestController
5
4
  test 'should be able to log in' do
@@ -1,5 +1,4 @@
1
1
  require 'test_controller'
2
- require 'editor/test_helper'
3
2
 
4
3
  class TagsControllerTest < TestController
5
4
  tests Admin::TagsController
@@ -1,5 +1,3 @@
1
- require 'editor/test_helper'
2
-
3
1
  class BaseHelperTest < ActionView::TestCase
4
2
  include Rails.application.routes.url_helpers
5
3
 
@@ -0,0 +1,23 @@
1
+ Ecrire::Application.paths.add 'config/secrets', with: Dir.pwd + '/test/secrets.yml'
2
+ Ecrire::Application.paths.add 'config/database', with: Dir.pwd + '/test/secrets.yml'
3
+
4
+ Ecrire::Application.initializer 'ecrire.automigrate', after: "active_record.initialize_database" do |app|
5
+ path = app.paths['db/migrate'].existent
6
+ ActiveRecord::Migrator.migrations_paths = path
7
+ if ActiveRecord::Migrator.needs_migration?
8
+ ActiveRecord::Migration.verbose = false
9
+ ActiveRecord::Migrator.migrate(path)
10
+ end
11
+ ActiveRecord::Migration.maintain_test_schema!
12
+ end
13
+
14
+ class ActiveSupport::TestCase
15
+ include ActiveRecord::TestFixtures
16
+ ActiveSupport.test_order = :random
17
+ self.fixture_path = "#{Dir.pwd}/test/fixtures/"
18
+ fixtures :all
19
+ end
20
+
21
+ Dir.chdir "test/editor/theme" do
22
+ Ecrire::Application.initialize!
23
+ end
@@ -1,5 +1,4 @@
1
1
  require 'test_helper'
2
- require 'editor/test_helper'
3
2
 
4
3
  class ImageTest < ActiveSupport::TestCase
5
4
 
@@ -1,5 +1,4 @@
1
1
  require 'test_helper'
2
- require 'editor/test_helper'
3
2
 
4
3
  class PostTest < ActiveSupport::TestCase
5
4
 
@@ -1,5 +1,4 @@
1
1
  require 'test_helper'
2
- require 'editor/test_helper'
3
2
 
4
3
  class TitleTest < ActiveSupport::TestCase
5
4
  test "length of name" do
@@ -1,5 +1,4 @@
1
1
  require 'test_helper'
2
- require 'editor/test_helper'
3
2
 
4
3
  class UserTest < ActiveSupport::TestCase
5
4
  end
@@ -21,7 +21,7 @@ class DatabasesControllerTest < TestController
21
21
  end
22
22
 
23
23
  test 'redirect to users if the connection is successful' do
24
- post :create, database: {user: 'postgres', password: '', name: 'ecrire_test'}
24
+ post :create, database: {name: 'ecrire_test', user: 'ecrire_test'}
25
25
  assert_redirected_to '/users'
26
26
  end
27
27
 
@@ -11,8 +11,8 @@ class UsersControllerTest < TestController
11
11
  setup do
12
12
  info ||= {
13
13
  'adapter' => 'postgresql',
14
+ 'user' => 'ecrire_test',
14
15
  'database' => 'ecrire_test',
15
- 'user' => 'postgres',
16
16
  'password' => 'password',
17
17
  'encoding' => 'utf8'
18
18
  }
@@ -0,0 +1,10 @@
1
+ ENV['VERBOSE'] = 'false'
2
+
3
+ class ActiveSupport::TestCase
4
+ ActiveSupport.test_order = :random
5
+ end
6
+
7
+ Dir.chdir "test/onboarding/theme" do
8
+ Ecrire::Application.initialize!
9
+ end
10
+
@@ -1,8 +1,8 @@
1
1
  test:
2
2
  adapter: postgresql
3
3
  database: ecrire_test
4
- user: postgres
4
+ username: ecrire_test
5
5
  secret_key: "2370 128u3o2ujwoi12jw122e12e"
6
6
  secret_key_base: "'Mlkasj alskjkdsla jsdkaljsadlkjasd'"
7
7
  s3:
8
- path: 'yada'
8
+ path: 'test'
@@ -1,20 +1,26 @@
1
1
  require 'rake/testtask'
2
2
 
3
- class Ecrire::TestTask < Rake::TestTask
4
- attr_accessor :theme
3
+ class Ecrire::Test::Task < Rake::TestTask
4
+
5
+ def before(&block)
6
+ @callback = block
7
+ end
5
8
 
6
9
  def define
7
10
  desc @description
8
11
  task @name do
12
+
13
+ unless @callback.nil?
14
+ @callback.call
15
+ end
16
+
9
17
  Rake::FileUtilsExt.verbose(@verbose) do
10
18
  args = [
11
19
  "#{ruby_opts_string} #{run_code} ",
12
20
  "#{file_list_string} #{option_list}"
13
21
  ]
14
22
 
15
- if File.exists?(theme)
16
- args << theme
17
- end
23
+ args << @name
18
24
 
19
25
  ruby args.join do |ok, status|
20
26
  if !ok && status.respond_to?(:signaled?) && status.signaled?
data/test/test_helper.rb CHANGED
@@ -11,14 +11,7 @@ require 'rails/generators/test_case'
11
11
  require 'warden'
12
12
  require 'byebug'
13
13
 
14
- Dir.chdir ARGV.pop do
15
- Ecrire::Application.initialize!
16
- end
17
-
18
-
19
- class ActiveSupport::TestCase
20
- ActiveSupport.test_order = :sorted
21
- end
14
+ require_relative "#{ARGV.pop}/initializers"
22
15
 
23
16
  class ActionController::TestCase
24
17
  include Warden::Test::Helpers
@@ -27,5 +20,3 @@ class ActionController::TestCase
27
20
  @routes = Rails.application.routes
28
21
  end
29
22
  end
30
-
31
-
@@ -0,0 +1,22 @@
1
+ Ecrire::Application.initializer 'ecrire.automigrate', after: "active_record.initialize_database" do |app|
2
+ path = app.paths['db/migrate'].existent
3
+ ActiveRecord::Migrator.migrations_paths = path
4
+ if ActiveRecord::Migrator.needs_migration?
5
+ ActiveRecord::Migrator.migrate(path)
6
+ end
7
+ ActiveRecord::Migration.maintain_test_schema!
8
+ end
9
+
10
+ class ActiveSupport::TestCase
11
+ include ActiveRecord::TestFixtures
12
+ ActiveSupport.test_order = :random
13
+ self.fixture_path = "#{Dir.pwd}/test/fixtures/"
14
+ fixtures :all
15
+ end
16
+
17
+ Ecrire::Application.paths.add 'config/secrets', with: Dir.pwd + '/test/secrets.yml'
18
+ Ecrire::Application.paths.add 'config/database', with: Dir.pwd + '/test/secrets.yml'
19
+
20
+ Dir.chdir "test/theme/theme" do
21
+ Ecrire::Application.initialize!
22
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecrire
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.27.0
4
+ version: 0.28.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pier-Olivier Thibault
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-28 00:00:00.000000000 Z
11
+ date: 2015-08-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Blog engine on Rails
14
14
  email: pothibo@gmail.com
@@ -54,24 +54,24 @@ files:
54
54
  - lib/ecrire/app/assets/javascripts/vendor/moment.js
55
55
  - lib/ecrire/app/assets/javascripts/vendor/prism.js
56
56
  - lib/ecrire/app/assets/javascripts/vendor/prism/prism.ruby.js
57
- - lib/ecrire/app/assets/stylesheets/admin.css.scss
58
- - lib/ecrire/app/assets/stylesheets/admin/base.css.scss
59
- - lib/ecrire/app/assets/stylesheets/admin/documentation.css.scss
60
- - lib/ecrire/app/assets/stylesheets/admin/header.css.scss
61
- - lib/ecrire/app/assets/stylesheets/admin/help.css.scss
62
- - lib/ecrire/app/assets/stylesheets/admin/images.css.scss
63
- - lib/ecrire/app/assets/stylesheets/admin/navigation.css.scss
64
- - lib/ecrire/app/assets/stylesheets/admin/posts.css.scss
65
- - lib/ecrire/app/assets/stylesheets/admin/save.css.scss
66
- - lib/ecrire/app/assets/stylesheets/admin/tags.css.scss
67
- - lib/ecrire/app/assets/stylesheets/admin/title.css.scss
68
- - lib/ecrire/app/assets/stylesheets/ecrire.css.scss
69
- - lib/ecrire/app/assets/stylesheets/editor/code.css.scss
70
- - lib/ecrire/app/assets/stylesheets/editor/content.css.scss
71
- - lib/ecrire/app/assets/stylesheets/editor/figure.css.scss
72
- - lib/ecrire/app/assets/stylesheets/sessions.css.scss
73
- - lib/ecrire/app/assets/stylesheets/shared/popup.css.scss
74
- - lib/ecrire/app/assets/stylesheets/variables.css.scss
57
+ - lib/ecrire/app/assets/stylesheets/admin.scss
58
+ - lib/ecrire/app/assets/stylesheets/admin/base.scss
59
+ - lib/ecrire/app/assets/stylesheets/admin/documentation.scss
60
+ - lib/ecrire/app/assets/stylesheets/admin/header.scss
61
+ - lib/ecrire/app/assets/stylesheets/admin/help.scss
62
+ - lib/ecrire/app/assets/stylesheets/admin/images.scss
63
+ - lib/ecrire/app/assets/stylesheets/admin/navigation.scss
64
+ - lib/ecrire/app/assets/stylesheets/admin/posts.scss
65
+ - lib/ecrire/app/assets/stylesheets/admin/save.scss
66
+ - lib/ecrire/app/assets/stylesheets/admin/tags.scss
67
+ - lib/ecrire/app/assets/stylesheets/admin/title.scss
68
+ - lib/ecrire/app/assets/stylesheets/ecrire.scss
69
+ - lib/ecrire/app/assets/stylesheets/editor/code.scss
70
+ - lib/ecrire/app/assets/stylesheets/editor/content.scss
71
+ - lib/ecrire/app/assets/stylesheets/editor/figure.scss
72
+ - lib/ecrire/app/assets/stylesheets/sessions.scss
73
+ - lib/ecrire/app/assets/stylesheets/shared/popup.scss
74
+ - lib/ecrire/app/assets/stylesheets/variables.scss
75
75
  - lib/ecrire/app/assets/stylesheets/vendor/prism.scss
76
76
  - lib/ecrire/app/assets/stylesheets/vendor/prism/ruby.scss
77
77
  - lib/ecrire/app/controllers/admin/application_controller.rb
@@ -251,6 +251,7 @@ files:
251
251
  - lib/ecrire/theme/template/controllers/tags_controller.rb
252
252
  - lib/ecrire/theme/template/helpers/blog_helper.rb
253
253
  - lib/ecrire/theme/template/routes.rb
254
+ - lib/ecrire/theme/template/secrets.yml
254
255
  - lib/ecrire/theme/template/views/layouts/application.html.erb
255
256
  - lib/ecrire/theme/template/views/posts/_latest.html.erb
256
257
  - lib/ecrire/theme/template/views/posts/_post.html.erb
@@ -270,15 +271,18 @@ files:
270
271
  - lib/ecrire/theme/template/views/tags/_post.html.erb
271
272
  - lib/ecrire/theme/template/views/tags/show.html.erb
272
273
  - lib/ecrire/version.rb
274
+ - test/configuration.rb
275
+ - test/configuration/postgresql.rb
276
+ - test/configuration/postgresql/user.rb
273
277
  - test/editor/controllers/posts_controller_test.rb
274
278
  - test/editor/controllers/sessions_controller_test.rb
275
279
  - test/editor/controllers/tags_controller_test.rb
276
280
  - test/editor/helpers/base_helper_test.rb
281
+ - test/editor/initializers.rb
277
282
  - test/editor/models/image_test.rb
278
283
  - test/editor/models/post_test.rb
279
284
  - test/editor/models/title_test.rb
280
285
  - test/editor/models/user_test.rb
281
- - test/editor/test_helper.rb
282
286
  - test/editor/theme/Gemfile
283
287
  - test/editor/theme/assets/javascripts/blog.js.coffee
284
288
  - test/editor/theme/assets/javascripts/post.js.coffee
@@ -286,7 +290,6 @@ files:
286
290
  - test/editor/theme/assets/stylesheets/post.css.scss
287
291
  - test/editor/theme/config.ru
288
292
  - test/editor/theme/routes.rb
289
- - test/editor/theme/secrets.yml
290
293
  - test/editor/theme/views/layouts/application.html.erb
291
294
  - test/editor/theme/views/posts/index.html.erb
292
295
  - test/fixtures/images.yml
@@ -298,16 +301,18 @@ files:
298
301
  - test/onboarding/controllers/databases_controller_test.rb
299
302
  - test/onboarding/controllers/onboarding_controller_test.rb
300
303
  - test/onboarding/controllers/users_controller_test.rb
304
+ - test/onboarding/initializers.rb
301
305
  - test/onboarding/theme/.keep
306
+ - test/secrets.yml
307
+ - test/task.rb
302
308
  - test/test_controller.rb
303
309
  - test/test_helper.rb
304
- - test/test_task.rb
305
310
  - test/theme/controllers/posts_controller_test.rb
306
311
  - test/theme/helpers/application_helper_test.rb
312
+ - test/theme/initializers.rb
307
313
  - test/theme/theme/config.ru
308
314
  - test/theme/theme/controllers/posts_controller.rb
309
315
  - test/theme/theme/routes.rb
310
- - test/theme/theme/secrets.yml
311
316
  - test/theme/theme/views/posts/index.html.erb
312
317
  - test/theme/theme/views/posts/show.html.erb
313
318
  homepage: http://pothibo.com
@@ -1,34 +0,0 @@
1
- class ActiveSupport::TestCase
2
- begin
3
- # ActiveRecord's configuration assignation is done at the same time as the connection is tried
4
- # If it fails, the configurations aren't set in AR::Base.
5
- # This is why this is set here
6
- ActiveRecord::Base.configurations = Rails.application.config.database_configuration
7
-
8
- path = Rails.application.paths['db/migrate'].existent
9
- ActiveRecord::Migrator.migrations_paths = path
10
- if ActiveRecord::Migrator.needs_migration?
11
- ActiveRecord::Migrator.migrate(path)
12
- end
13
- rescue ActiveRecord::NoDatabaseError
14
- puts 'Database does not exist. Creating...'
15
- ActiveRecord::Tasks::DatabaseTasks.create_current
16
- puts 'Database created, migrating now...'
17
- ActiveRecord::Migrator.migrate(path)
18
- puts "Migration completed."
19
- ensure
20
- ActiveRecord::Migration.maintain_test_schema!
21
- include ActiveRecord::TestFixtures
22
- self.fixture_path = "#{Dir.pwd}/test/fixtures/"
23
- fixtures :all
24
- Post.reset_column_information
25
- end
26
-
27
-
28
- end
29
-
30
- ActionDispatch::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path
31
-
32
- def create_fixtures(*fixture_set_names, &block)
33
- FixtureSet.create_fixtures(ActiveSupport::TestCase.fixture_path, fixture_set_names, {}, &block)
34
- end
@@ -1,8 +0,0 @@
1
- test:
2
- secret_key_base: 'kasjdklasj !*u3 12812u kjH JH!@ uh21ek jh12l12k'
3
- adapter: postgresql
4
- database: ecrire_test
5
- user: postgres
6
- encoding: utf8
7
- s3:
8
- bucket_name: 'test'