refinerycms 0.9.7.8 → 0.9.7.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. data/.gitignore +4 -1
  2. data/Gemfile +1 -1
  3. data/bin/refinery-upgrade-096-to-097 +30 -13
  4. data/bin/refinerycms +32 -20
  5. data/changelog.md +14 -0
  6. data/db/migrate/20100729221735_remove_page_translations_if_present.rb +12 -0
  7. data/db/schema.rb +13 -15
  8. data/features/refinery/create_inquiries.feature +40 -0
  9. data/features/refinery/dashboard.feature +35 -1
  10. data/features/refinery/manage_files.feature +42 -1
  11. data/features/refinery/manage_images.feature +58 -1
  12. data/features/refinery/manage_inquiries.feature +55 -3
  13. data/features/refinery/manage_pages.feature +1 -1
  14. data/features/refinery/manage_refinery_settings.feature +1 -0
  15. data/features/refinery/manage_users.feature +1 -1
  16. data/features/refinery/plugin_generator.feature +27 -0
  17. data/features/refinery/site_bar.feature +4 -3
  18. data/features/refinery/theme_generator.feature +16 -0
  19. data/features/step_definitions/refinery/core_steps.rb +4 -0
  20. data/features/step_definitions/refinery/file_steps.rb +22 -0
  21. data/features/step_definitions/refinery/generator_steps.rb +11 -0
  22. data/features/step_definitions/refinery/image_steps.rb +43 -0
  23. data/features/step_definitions/refinery/inquiry_steps.rb +13 -0
  24. data/features/step_definitions/refinery/page_steps.rb +4 -6
  25. data/features/step_definitions/refinery/plugin_generator_steps.rb +16 -0
  26. data/features/step_definitions/refinery/theme_generator_steps.rb +15 -0
  27. data/features/step_definitions/refinery/user_steps.rb +1 -1
  28. data/features/step_definitions/web_steps.rb +18 -18
  29. data/features/support/env.rb +6 -7
  30. data/features/support/paths.rb +25 -1
  31. data/features/uploads/beach.INVALID +0 -0
  32. data/features/uploads/beach.jpeg +0 -0
  33. data/features/uploads/id-rather-be-here.jpg +0 -0
  34. data/features/uploads/refinery_is_awesome.txt +1 -0
  35. data/public/javascripts/refinery/admin.js +4 -4
  36. data/public/stylesheets/refinery/refinery.css +4 -1
  37. data/readme.md +1 -1
  38. data/todo.md +20 -8
  39. data/vendor/plugins/authentication/app/models/user.rb +1 -1
  40. data/vendor/plugins/dashboard/app/views/admin/dashboard/index.rss.builder +26 -0
  41. data/vendor/plugins/inquiries/app/views/admin/inquiries/_inquiry.html.erb +2 -1
  42. data/vendor/plugins/inquiries/app/views/admin/inquiry_settings/_confirmation_email_form.html.erb +9 -5
  43. data/vendor/plugins/inquiries/config/locales/en.yml +2 -2
  44. data/vendor/plugins/inquiries/config/routes.rb +14 -4
  45. data/vendor/plugins/pages/app/controllers/pages_controller.rb +3 -1
  46. data/vendor/plugins/refinery/app/views/shared/_google_analytics.html.erb +2 -2
  47. data/vendor/plugins/refinery/app/views/shared/_menu.html.erb +18 -13
  48. data/vendor/plugins/refinery/app/views/shared/admin/_form_actions.html.erb +3 -0
  49. data/vendor/plugins/refinery/app/views/shared/admin/_search.html.erb +1 -3
  50. data/vendor/plugins/refinery/config/locales/en.yml +1 -1
  51. data/vendor/plugins/refinery/lib/crud.rb +4 -1
  52. data/vendor/plugins/refinery/lib/generators/refinery/refinery_generator.rb +4 -61
  53. data/vendor/plugins/refinery/lib/generators/refinery_plugin/README +36 -0
  54. data/vendor/plugins/refinery/lib/generators/{refinery → refinery_plugin}/Rakefile +2 -3
  55. data/vendor/plugins/refinery/lib/generators/refinery_plugin/USAGE +2 -0
  56. data/vendor/plugins/refinery/lib/generators/{refinery → refinery_plugin}/install.rb +0 -0
  57. data/vendor/plugins/refinery/lib/generators/refinery_plugin/refinery_plugin_generator.rb +76 -0
  58. data/vendor/plugins/refinery/lib/generators/{refinery → refinery_plugin}/templates/MIGRATE +0 -0
  59. data/vendor/plugins/refinery/lib/generators/{refinery → refinery_plugin}/templates/config/locales/en.yml +4 -1
  60. data/vendor/plugins/refinery/lib/generators/{refinery → refinery_plugin}/templates/config/locales/nb.yml +4 -1
  61. data/vendor/plugins/refinery/lib/generators/{refinery → refinery_plugin}/templates/config/locales/nl.yml +4 -1
  62. data/vendor/plugins/refinery/lib/generators/{refinery → refinery_plugin}/templates/config/routes.rb +0 -0
  63. data/vendor/plugins/refinery/lib/generators/{refinery → refinery_plugin}/templates/controller.rb +0 -0
  64. data/vendor/plugins/refinery/lib/generators/{refinery → refinery_plugin}/templates/migration.rb +0 -0
  65. data/vendor/plugins/refinery/lib/generators/{refinery → refinery_plugin}/templates/model.rb +0 -0
  66. data/vendor/plugins/refinery/lib/generators/{refinery → refinery_plugin}/templates/public_controller.rb +0 -0
  67. data/vendor/plugins/refinery/lib/generators/refinery_plugin/templates/rails/init.rb +9 -0
  68. data/vendor/plugins/refinery/lib/generators/{refinery → refinery_plugin}/templates/seed.rb +0 -0
  69. data/vendor/plugins/refinery/lib/generators/{refinery → refinery_plugin}/templates/views/admin/_form.html.erb +0 -0
  70. data/vendor/plugins/refinery/lib/generators/{refinery → refinery_plugin}/templates/views/admin/_singular_name.html.erb +0 -0
  71. data/vendor/plugins/refinery/lib/generators/{refinery → refinery_plugin}/templates/views/admin/_sortable_list.html.erb +0 -0
  72. data/vendor/plugins/refinery/lib/generators/{refinery → refinery_plugin}/templates/views/admin/edit.html.erb +0 -0
  73. data/vendor/plugins/refinery/lib/generators/{refinery → refinery_plugin}/templates/views/admin/index.html.erb +0 -0
  74. data/vendor/plugins/refinery/lib/generators/{refinery → refinery_plugin}/templates/views/admin/new.html.erb +0 -0
  75. data/vendor/plugins/refinery/lib/generators/{refinery → refinery_plugin}/templates/views/index.html.erb +0 -0
  76. data/vendor/plugins/refinery/lib/generators/{refinery → refinery_plugin}/templates/views/show.html.erb +0 -0
  77. data/vendor/plugins/refinery/lib/refinery.rb +1 -1
  78. data/vendor/plugins/refinery/lib/refinery/activity.rb +3 -3
  79. data/vendor/plugins/refinery/lib/refinery/application_controller.rb +1 -1
  80. data/vendor/plugins/refinery/lib/tasks/refinery.rake +109 -32
  81. data/vendor/plugins/refinery/plugins.md +3 -3
  82. data/vendor/plugins/refinery_settings/app/models/refinery_setting.rb +26 -10
  83. data/vendor/plugins/refinery_settings/app/views/admin/refinery_settings/_form.html.erb +1 -2
  84. data/vendor/plugins/themes/generators/refinery_theme/README +17 -0
  85. data/vendor/plugins/themes/generators/refinery_theme/Rakefile +11 -0
  86. data/vendor/plugins/themes/generators/refinery_theme/USAGE +2 -0
  87. data/vendor/plugins/themes/generators/refinery_theme/install.rb +2 -0
  88. data/vendor/plugins/themes/generators/refinery_theme/refinery_theme_generator.rb +41 -0
  89. data/vendor/plugins/themes/generators/refinery_theme/templates/stylesheets/application.css +5 -0
  90. data/vendor/plugins/themes/generators/refinery_theme/templates/stylesheets/formatting.css +7 -0
  91. data/vendor/plugins/themes/generators/refinery_theme/templates/stylesheets/home.css +5 -0
  92. data/vendor/plugins/themes/generators/refinery_theme/templates/views/layouts/application.html.erb +21 -0
  93. data/vendor/plugins/themes/generators/refinery_theme/templates/views/pages/home.html.erb +4 -0
  94. data/vendor/plugins/themes/generators/refinery_theme/templates/views/pages/show.html.erb +4 -0
  95. data/vendor/plugins/themes/rails/init.rb +0 -1
  96. data/vendor/plugins/themes/readme.md +7 -2
  97. metadata +54 -28
  98. data/db/migrate/20100606173919_create_page_translations.rb +0 -12
  99. data/vendor/plugins/refinery/lib/generators/refinery/README +0 -30
  100. data/vendor/plugins/refinery/lib/generators/refinery/USAGE +0 -2
  101. data/vendor/plugins/refinery/lib/generators/refinery/templates/rails/init.rb +0 -13
data/.gitignore CHANGED
@@ -36,6 +36,9 @@ index/**/*
36
36
  # NetBeans
37
37
  nbproject
38
38
 
39
+ # Eclipse
40
+ .project
41
+
39
42
  # Redcar
40
43
  .redcar
41
44
  tags
@@ -61,4 +64,4 @@ capybara-*html
61
64
  config/database.yml
62
65
  config/amazon_s3.yml
63
66
  config/rackspace_cloudfiles.yml
64
- #===END OF REMOVED DURING REFINERY GEM INSTALL===
67
+ #===END OF REMOVED DURING REFINERY GEM INSTALL===
data/Gemfile CHANGED
@@ -45,7 +45,7 @@ end
45
45
 
46
46
  #===REQUIRED FOR REFINERY GEM INSTALL===
47
47
  # Leave the gem below disabled (commented out) if you're not using the gem install method.
48
- # gem 'refinerycms', '= 0.9.7.8'
48
+ # gem 'refinerycms', '= 0.9.7.9'
49
49
  #===END OF REFINERY GEM INSTALL REQUIREMENTS===
50
50
 
51
51
  # Bundle gems for certain environments:
@@ -3,7 +3,12 @@ require 'pathname'
3
3
  require 'fileutils'
4
4
  require 'yaml'
5
5
 
6
- refinery_root = (defined?(REFINERY_ROOT) && REFINERY_ROOT.is_a?(Pathname) ? REFINERY_ROOT : Pathname.new(File.expand_path(File.dirname(__FILE__) << "/..")))
6
+ refinery_root = if defined?(REFINERY_ROOT) and (REFINERY_ROOT.is_a?(Pathname)
7
+ REFINERY_ROOT
8
+ else
9
+ Pathname.new(File.expand_path(File.dirname(__FILE__) << "/.."))
10
+ end
11
+
7
12
  unless (app_path = ARGV.shift).nil? or app_path.length == 0
8
13
  # if "" or "." or "./" is specified then get the current directory otherwise accept the specified app_path.
9
14
  if (app_path.length <= 2 and ((is_current_dir = app_path =~ /(\.(\/)?)/).nil? or is_current_dir < 2))
@@ -19,8 +24,12 @@ unless (app_path = ARGV.shift).nil? or app_path.length == 0
19
24
  end
20
25
  puts "--------Updating--------\n\n"
21
26
 
22
- FileUtils::cp refinery_root.join('Gemfile').to_s, rails_root.join('Gemfile').to_s, :verbose => true
23
- FileUtils::cp refinery_root.join('config', 'preinitializer.rb').to_s, rails_root.join('config', 'preinitializer.rb').to_s, :verbose => true
27
+ FileUtils::cp refinery_root.join('Gemfile').to_s,
28
+ rails_root.join('Gemfile').to_s,
29
+ :verbose => true
30
+ FileUtils::cp refinery_root.join('config', 'preinitializer.rb').to_s,
31
+ rails_root.join('config', 'preinitializer.rb').to_s,
32
+ :verbose => true
24
33
 
25
34
  # try to figure out the database adapter..
26
35
  db_adapter = 'sqlite3'
@@ -49,28 +58,36 @@ unless (app_path = ARGV.shift).nil? or app_path.length == 0
49
58
  end
50
59
 
51
60
  # write the new content into the file.
52
- app_gemfile = File.open(File.join(%W(#{rails_root} Gemfile)), "w")
61
+ app_gemfile = rails_root.join('Gemfile').open('w')
53
62
  app_gemfile.puts(lines.join("\n"))
54
63
  app_gemfile.close
55
64
 
56
65
  # backup the config file.
57
66
  app_config_file = 'application.rb'
58
- FileUtils.cp rails_root.join('config', app_config_file).cleanpath.to_s, rails_root.join('config', "#{app_config_file.gsub('.rb', '')}.autobackupbyrefineryupgrade.rb").cleanpath.to_s, :verbose => true
67
+ FileUtils.cp rails_root.join('config', app_config_file).cleanpath.to_s,
68
+ rails_root.join('config', "#{app_config_file.gsub('.rb', '')}.autobackupbyrefineryupgrade.rb").cleanpath.to_s,
69
+ :verbose => true
59
70
 
60
71
  # copy the new config file.
61
- FileUtils.cp refinery_root.join('config', app_config_file).cleanpath.to_s, rails_root.join('config', app_config_file).cleanpath.to_s, :verbose => true
62
-
63
- unless File.exist?(rails_root.join('config', 'settings.rb'))
64
- FileUtils.cp refinery_root.join('config', 'settings.rb').cleanpath.to_s, rails_root.join('config', 'settings.rb').cleanpath.to_s, :verbose => true
72
+ FileUtils.cp refinery_root.join('config', app_config_file).cleanpath.to_s,
73
+ rails_root.join('config', app_config_file).cleanpath.to_s,
74
+ :verbose => true
75
+
76
+ unless (rails_config_settings = rails_root.join('config', 'settings.rb')).exist?
77
+ FileUtils.cp refinery_root.join('config', 'settings.rb').cleanpath.to_s,
78
+ rails_config_settings.to_s,
79
+ :verbose => true
65
80
  end
66
81
 
67
82
  unless (aai_config_file = rails_root.join('config', 'acts_as_indexed_config.rb')).exist?
68
- FileUtils::cp refinery_root.join('config', 'acts_as_indexed_config.rb').to_s, aai_config_file.to_s, :verbose => true
83
+ FileUtils::cp refinery_root.join('config', 'acts_as_indexed_config.rb').to_s,
84
+ aai_config_file.to_s,
85
+ :verbose => true
69
86
  end
70
87
 
71
88
  # update routes files
72
89
  puts "\nNow I'm verifying and updating your routing in your files and your plugins...\n"
73
- Dir[rails_root.join('**', 'config', 'routes.rb')].map{|f| Pathname.new(f)}.each do |routes_file|
90
+ Dir[rails_root.join('**', 'config', 'routes.rb').to_s].map{|f| Pathname.new(f)}.each do |routes_file|
74
91
  open_routes_file = routes_file.open('r')
75
92
  lines = open_routes_file.read.split("\n")
76
93
  original_lines = lines.dup
@@ -103,11 +120,11 @@ unless (app_path = ARGV.shift).nil? or app_path.length == 0
103
120
 
104
121
  if rails_root.join('config', 'database.yml').exist?
105
122
  puts "\n\nUpdating some core refinery files..\n"
106
- puts (cmd="rake -f '#{File.join(rails_root, 'Rakefile')}' refinery:update from_installer=true")
123
+ puts (cmd="rake -f '#{rails_root.join('Rakefile')}' refinery:update from_installer=true")
107
124
  puts `cd '#{rails_root}' && #{cmd}`
108
125
 
109
126
  puts "\n\nMigrating your database..\n"
110
- puts (cmd="rake -f '#{File.join(rails_root, 'Rakefile')}' db:migrate")
127
+ puts (cmd="rake -f '#{rails_root.join('Rakefile')}' db:migrate")
111
128
  puts `cd '#{rails_root}' && #{cmd}`
112
129
  else
113
130
  puts "\nYour config/database.yml file is missing so I can't run a task that is required."
data/bin/refinerycms CHANGED
@@ -11,7 +11,12 @@ rescue LoadError
11
11
  exit
12
12
  end
13
13
 
14
- refinery_root = (defined?(REFINERY_ROOT) && REFINERY_ROOT.is_a?(Pathname) ? REFINERY_ROOT : Pathname.new(File.expand_path(File.dirname(__FILE__) << "/..")))
14
+ refinery_root = if defined?(REFINERY_ROOT) and REFINERY_ROOT.is_a?(Pathname)
15
+ REFINERY_ROOT
16
+ else
17
+ Pathname.new(File.expand_path(File.dirname(__FILE__) << "/.."))
18
+ end
19
+
15
20
  unless (app_path = ARGV.shift).nil? or app_path.length == 0
16
21
  # if "" or "." or "./" is specified then get the current directory otherwise accept the specified app_path.
17
22
  if (app_path.length <= 2 and ((is_current_dir = app_path =~ /(\.(\/)?)/).nil? or is_current_dir < 2))
@@ -19,11 +24,12 @@ unless (app_path = ARGV.shift).nil? or app_path.length == 0
19
24
  else
20
25
  rails_root = app_path =~ /^\// ? app_path : File.expand_path(File.join(Dir.getwd, app_path.gsub(/^\.\//, '')))
21
26
  end
27
+ rails_root = Pathname.new(rails_root.to_s)
22
28
 
23
- if File.directory?(rails_root)
29
+ if rails_root.directory?
24
30
  if ARGV.include?("--force")
25
31
  # remove the contents of the current directory
26
- Dir[File.join(rails_root, "*")].each {|dir| FileUtils::rm_rf(dir, :secure => true) }
32
+ Dir[rails_root.join('*').to_s].each {|dir| FileUtils::rm_rf(dir, :secure => true) }
27
33
  else
28
34
  puts "The path you specified already exists. If you want to override this directory (i.e. delete all the current contents) run this again with --force"
29
35
  end
@@ -40,8 +46,12 @@ unless (app_path = ARGV.shift).nil? or app_path.length == 0
40
46
  FileUtils::cp_r to_copy.compact, rails_root, :verbose => false
41
47
 
42
48
  # ensure lib/refinery_initializer.rb and lib/gemspec.rb don't make it in.
43
- FileUtils::rm File.join(%W(#{rails_root} lib refinery_initializer.rb)) if File.exists?(File.join(%W(#{rails_root} lib refinery_initializer.rb)))
44
- FileUtils::rm File.join(%W(#{rails_root} lib gemspec.rb)) if File.exists?(File.join(%W(#{rails_root} lib gemspec.rb)))
49
+ if (initializer=rails_root.join('lib', 'refinery_initializer.rb')).exist?
50
+ FileUtils::rm initializer.to_s
51
+ end
52
+ if (gemspec = rails_root.join('lib', 'gemspec.rb')).exist?
53
+ FileUtils::rm gemspec.to_s
54
+ end
45
55
 
46
56
  # copy the appropriate database adapter as specified (or not)
47
57
  db_adapter = 'sqlite3'
@@ -51,17 +61,19 @@ unless (app_path = ARGV.shift).nil? or app_path.length == 0
51
61
  db_adapter = arg_parts.last if arg_parts.first == '--database'
52
62
  end
53
63
  end
54
- FileUtils::cp File.join(%W(#{rails_root} config database.yml.#{db_adapter})), File.join(%W(#{rails_root} config database.yml.example))
64
+ FileUtils::cp rails_root.join('config', "database.yml.#{db_adapter}").to_s,
65
+ rails_root.join('config', 'database.yml.example').to_s
55
66
 
56
67
  # add in the config files
57
68
  %w(database amazon_s3 rackspace_cloudfiles).each do |config|
58
- FileUtils::move File.join(%W(#{rails_root} config #{config}.yml.example)), File.join(%W(#{rails_root} config #{config}.yml))
69
+ FileUtils::move rails_root.join('config', "#{config}.yml.example").to_s,
70
+ rails_root.join('config', "#{config}.yml").to_s
59
71
 
60
72
  # figure out the app name from the install path and swap out your_local_xxx with this name.
61
- unless rails_root == "/" or RUBY_PLATFORM =~ /mswin/
62
- app_name = rails_root.split(File::SEPARATOR).last
73
+ unless rails_root.to_s == "/" or RUBY_PLATFORM =~ /mswin/
74
+ app_name = rails_root.to_s.split(File::SEPARATOR).last
63
75
  # read in the file and split up the lines
64
- lines = File.open(File.join(%W(#{rails_root} config #{config}.yml)), "r").read.split("\n")
76
+ lines = rails_root.join('config', "#{config}.yml").open('r').read.split("\n")
65
77
  lines.each do |line|
66
78
  line.gsub!("your_local_#{config}", "#{app_name}_development")
67
79
  line.gsub!("your_test_#{config}", "#{app_name}_test")
@@ -69,7 +81,7 @@ unless (app_path = ARGV.shift).nil? or app_path.length == 0
69
81
  line.gsub!("your_production_#{config}", "#{app_name}_production")
70
82
  end
71
83
  # write the new content into the file.
72
- config_file = File.open(File.join(%W(#{rails_root} config #{config}.yml)), "w")
84
+ config_file = rails_root.join('config', "#{config}.yml").open('w')
73
85
  config_file.puts(lines.join("\n"))
74
86
  config_file.close
75
87
  end
@@ -81,15 +93,15 @@ unless (app_path = ARGV.shift).nil? or app_path.length == 0
81
93
  3.times { new_digest << Digest::SHA1.hexdigest("--refinery--#{Time.now.to_s}--#{rand(10000000)}--") }
82
94
 
83
95
  # read in the file and split up the lines
84
- app_config_file = File.exist?(File.join(%W(#{rails_root} config application.rb))) ? "application.rb" : "environment.rb"
85
- lines = File.open(File.join(%W(#{rails_root} config #{app_config_file})), "r").read.split("\n")
96
+ app_config_file = rails_root.join('config', 'application.rb').exist? ? "application.rb" : "environment.rb"
97
+ lines = rails_root.join('config', app_config_file).open('r').read.split("\n")
86
98
  lines.each do |line|
87
99
  match = line.scan(/(:secret)([^']*)([\'])([^\']*)/).flatten.last
88
100
  line.gsub!(match, new_digest) unless match.nil?
89
101
  end
90
102
 
91
103
  # write the new content into the config file.
92
- app_config = File.open(File.join(%W(#{rails_root} config #{app_config_file})), "w")
104
+ app_config = rails_root.join('config', app_config_file).open('w')
93
105
  app_config.puts(lines.join("\n"))
94
106
  app_config.close
95
107
 
@@ -109,7 +121,7 @@ unless (app_path = ARGV.shift).nil? or app_path.length == 0
109
121
  end
110
122
 
111
123
  # write the new content into the file.
112
- app_gemfile = File.open(File.join(%W(#{rails_root} Gemfile)), "w")
124
+ app_gemfile = rails_root.join('Gemfile').open('w')
113
125
  app_gemfile.puts(lines.join("\n"))
114
126
  app_gemfile.close
115
127
 
@@ -117,9 +129,9 @@ unless (app_path = ARGV.shift).nil? or app_path.length == 0
117
129
  ignore_content = refinery_root.join('.gitignore').read
118
130
  ignore_content.gsub!(/#===REMOVED DURING REFINERY GEM INSTALL===.*#===END OF REMOVED DURING REFINERY GEM INSTALL===/m, '')
119
131
 
120
- File.open(File.join(%W(#{rails_root} .gitignore)), "w") do |f|
121
- f.puts(ignore_content)
122
- end
132
+ rails_gitignore = rails_root.join('.gitignore').open('w')
133
+ rails_gitignore.puts(ignore_content)
134
+ rails_gitignore.close
123
135
 
124
136
  puts "\n---------"
125
137
  puts "Refinery successfully installed in '#{rails_root}'!\n\n"
@@ -130,11 +142,11 @@ unless (app_path = ARGV.shift).nil? or app_path.length == 0
130
142
  puts `cd '#{rails_root}' && #{cmd}`
131
143
 
132
144
  puts "\n\nSetting up your development database..\n"
133
- puts "Running: " + (cmd="rake -f '#{File.join(rails_root, 'Rakefile')}' db:setup")
145
+ puts "Running: " + (cmd="rake -f '#{rails_root.join('Rakefile')}' db:setup")
134
146
  puts `cd '#{rails_root}' && #{cmd}`
135
147
 
136
148
  puts "\n\nUpdating some core refinery files..\n"
137
- puts "Running: " + (cmd="rake -f '#{File.join(rails_root, 'Rakefile')}' refinery:update from_installer=true")
149
+ puts "Running: " + (cmd="rake -f '#{rails_root.join('Rakefile')}' refinery:update from_installer=true")
138
150
  puts `cd '#{rails_root}' && #{cmd}`
139
151
  # end automation..
140
152
 
data/changelog.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## 0.9.7.9 [30 July 2010]
2
+
3
+ - Added a theme generator to create the basic file structure of a new theme. [David Jones](http://github.com/djones) and [Levi Cole](http://github.com/levicole)
4
+ - Renamed ``script/generate refinery`` to ``script/generate refinery_plugin``. [David Jones](http://github.com/djones)
5
+ - Add deprecation notice to ``script/generate refinery``. [David Jones](http://github.com/djones)
6
+ - Updated documentation to reflect new generator changes. [David Jones](http://github.com/djones)
7
+ - Added tests for both plugin and theme generators. [David Jones](http://github.com/djones) and [Levi Cole](http://github.com/levicole)
8
+ - Refactored the ``refinerycms`` & ``refinery-upgrade-097-to-097`` tasks to make better use of Pathname. [Philip Arndt](http://github.com/parndt)
9
+ - Added more cucumber features and tagged existing ones. [Philip Arndt](http://github.com/parndt), [James Fiderlick](http://github.com/jamesfid) and [Steven Heidel](http://github.com/stevenheidel)
10
+ - Removed mysterious ``page_translations`` table if you had it. [Philip Arndt](http://github.com/parndt)
11
+ - Added workaround for tests that involve dialogues. [Uģis Ozols](http://github.com/ugisozols)
12
+ - Added as default the ability for forms to know whether they are inside a modal / dialog. [Philip Arndt](http://github.com/parndt)
13
+ - [See full list](http://github.com/resolve/refinerycms/compare/0.9.7.8...0.9.7.9)
14
+
1
15
  ## 0.9.7.8 [23 July 2010]
2
16
 
3
17
  - Refactored Amazon S3 and gem installation to make it easier to install on Heroku. [Steven Heidel](http://github.com/stevenheidel)
@@ -0,0 +1,12 @@
1
+ class RemovePageTranslationsIfPresent < ActiveRecord::Migration
2
+ def self.up
3
+ begin
4
+ drop_table :page_translations
5
+ rescue
6
+ puts "-- page_translations did not exist, all is well."
7
+ end
8
+ end
9
+
10
+ def self.down
11
+ end
12
+ end
data/db/schema.rb CHANGED
@@ -12,20 +12,17 @@
12
12
  ActiveRecord::Schema.define(:version => 20100708014636) do
13
13
 
14
14
  create_table "images", :force => true do |t|
15
- t.integer "parent_id"
16
- t.string "content_type"
17
- t.string "filename"
18
- t.string "thumbnail"
19
- t.integer "size"
20
- t.integer "width"
21
- t.integer "height"
22
- t.string "image_type"
15
+ t.string "image_mime_type"
16
+ t.string "image_name"
17
+ t.integer "image_size"
18
+ t.integer "image_width"
19
+ t.integer "image_height"
23
20
  t.datetime "created_at"
24
21
  t.datetime "updated_at"
22
+ t.string "image_uid", :null => false
23
+ t.string "image_ext"
25
24
  end
26
25
 
27
- add_index "images", ["parent_id"], :name => "index_images_on_parent_id"
28
-
29
26
  create_table "inquiries", :force => true do |t|
30
27
  t.string "name"
31
28
  t.string "email"
@@ -101,12 +98,13 @@ ActiveRecord::Schema.define(:version => 20100708014636) do
101
98
  add_index "refinery_settings", ["name"], :name => "index_refinery_settings_on_name"
102
99
 
103
100
  create_table "resources", :force => true do |t|
104
- t.string "content_type"
105
- t.string "filename"
106
- t.integer "size"
107
- t.integer "parent_id"
101
+ t.string "file_mime_type"
102
+ t.string "file_name"
103
+ t.integer "file_size"
108
104
  t.datetime "created_at"
109
105
  t.datetime "updated_at"
106
+ t.string "file_uid", :null => false
107
+ t.string "file_ext"
110
108
  end
111
109
 
112
110
  create_table "roles", :force => true do |t|
@@ -136,7 +134,7 @@ ActiveRecord::Schema.define(:version => 20100708014636) do
136
134
  t.integer "position"
137
135
  end
138
136
 
139
- add_index "user_plugins", ["name"], :name => "index_user_plugins_on_name"
137
+ add_index "user_plugins", ["name"], :name => "index_user_plugins_on_title"
140
138
  add_index "user_plugins", ["user_id", "name"], :name => "index_unique_user_plugins", :unique => true
141
139
 
142
140
  create_table "users", :force => true do |t|
@@ -0,0 +1,40 @@
1
+ @inquiries @inquiries-create
2
+ Feature: Create Inquiries
3
+ In order to contact the website owner
4
+ I want to create an inquiry
5
+
6
+ Background:
7
+ Given A Refinery user exists
8
+ And I have no inquiries
9
+ And I have a page titled "Contact Us" with a custom url "/contact"
10
+ And I have a page titled "Thank You" with a custom url "/contact/thank_you"
11
+
12
+ Scenario: Contact page
13
+ When I go to the contact page
14
+ Then I should see "Name *"
15
+ And I should see "Email *"
16
+ And I should see "Phone"
17
+ And I should see "Message *"
18
+
19
+ Scenario: Create a valid inquiry
20
+ When I go to the contact page
21
+ And I fill in "Name *" with "Philip"
22
+ And I fill in "Email *" with "phil@refinerycms.com"
23
+ And I fill in "Message *" with "It sure is good to have a functional test coverage."
24
+ And I press "Send"
25
+ Then I should be on the contact thank you page
26
+ And I should see "Thank You"
27
+ And I should see "received your inquiry"
28
+ And I should see "Return to the home page"
29
+ And I should have 1 inquiries
30
+
31
+ Scenario: Create an invalid inquiry
32
+ When I go to the contact page
33
+ And I press "Send"
34
+ Then I should be on the contact create page
35
+ And I should see "Name can't be blank"
36
+ And I should not see "Email can't be blank"
37
+ And I should see "Email is invalid"
38
+ And I should not see "Phone can't be blank"
39
+ And I should see "Message can't be blank"
40
+ And I should have 0 inquiries
@@ -1,4 +1,38 @@
1
+ @dashboard
1
2
  Feature: Dashboard
2
3
  In order to see recent changes to my website
3
4
  As an administrator
4
- I want to use the dashboard
5
+ I want to use the dashboard
6
+
7
+ Background:
8
+ Given I am a logged in refinery user
9
+
10
+ Scenario: Translation options available
11
+ When I go to the Dashboard
12
+ Then I should see "English Change Language"
13
+
14
+ Scenario: Change Language to Slovenian and back to English
15
+ When I go to the dashboard
16
+ And I follow "English Change Language"
17
+ And I follow "Slovenian"
18
+ Then I should be on the dashboard
19
+ And I should see "Slovenian Spremeni Jezik"
20
+ And I should not see "Switch to your website"
21
+ # Back to English
22
+ When I follow "Slovenian Spremeni Jezik"
23
+ And I follow "English"
24
+ Then I should be on the dashboard
25
+ And I should see "Switch to your website"
26
+ And I should not see "Spremeni Jezik"
27
+
28
+ Scenario: Upload an Image Button
29
+
30
+ Scenario: Add New Page Button
31
+ When I go to the dashboard
32
+ And I follow "Add a new page"
33
+ Then I should be on the new page form
34
+ When I fill in "Title" with "Page test from Dashboard"
35
+ And I press "Save"
36
+ Then I should be on the dashboard
37
+ And I should see "'Page test from Dashboard' was successfully created."
38
+ And I should see "Page test from dashboard page was created"
@@ -1,4 +1,45 @@
1
+ @files @files-manage
1
2
  Feature: Manage Files
2
3
  In order to control the content on my website
3
4
  As an administrator
4
- I want to create and manage files
5
+ I want to create and manage files
6
+
7
+ Background:
8
+ Given I am a logged in refinery user
9
+
10
+ Scenario: Create Valid File
11
+ Given I have no files
12
+ When I go to the list of files
13
+ And I follow "Upload New File"
14
+ When I attach the file at "features/uploads/refinery_is_awesome.txt"
15
+ And I press "Save"
16
+ Then the file "refinery_is_awesome.txt" should have uploaded successfully
17
+ And I should have 1 file
18
+
19
+ Scenario: Edit Existing File
20
+ Given I have no files
21
+ When I upload the file at "features/uploads/refinery_is_awesome.txt"
22
+ Then I go to the list of files
23
+ And I follow "Edit this file"
24
+ And I attach the file at "features/uploads/beach.jpeg"
25
+ And I press "Save"
26
+ Then the file "beach.jpeg" should have uploaded successfully
27
+ And I should have 1 file
28
+
29
+ Scenario: Download Existing File
30
+ Given I have no files
31
+ When I upload the file at "features/uploads/refinery_is_awesome.txt"
32
+ Then I go to the list of files
33
+ And I follow "Download this file"
34
+ Then I should see "http://www.refineryhq.com/"
35
+
36
+ Scenario: Files Delete
37
+ #The 'follow "Remove this file forever" line is failing -- needs fixed.
38
+ #Given I have no files
39
+ #When I upload the file at "features/uploads/refinery_is_awesome.txt"
40
+ #Then I go to the list of files
41
+ #And I follow "Remove this file forever"
42
+ #And I press "OK"
43
+ #Then I should see "Flash message here.. not in place?"
44
+ #And I should have 0 files
45
+