smalruby-editor 0.0.8-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of smalruby-editor might be problematic. Click here for more details.

Files changed (110) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +25 -0
  3. data/.rspec +4 -0
  4. data/.rubocop.yml +19 -0
  5. data/.ruby-version +1 -0
  6. data/.simplecov +7 -0
  7. data/.travis.yml +23 -0
  8. data/LEGAL +13 -0
  9. data/LICENSE +22 -0
  10. data/Procfile +1 -0
  11. data/README.rdoc +46 -0
  12. data/Rakefile +9 -0
  13. data/app/assets/images/.keep +0 -0
  14. data/app/assets/images/favicon.ico +0 -0
  15. data/app/assets/javascripts/application.js +21 -0
  16. data/app/assets/javascripts/editor.js.coffee.erb +139 -0
  17. data/app/assets/stylesheets/application.css +19 -0
  18. data/app/assets/stylesheets/editor.css.scss +19 -0
  19. data/app/assets/stylesheets/flatstrap-custom.css.scss +2 -0
  20. data/app/controllers/application_controller.rb +5 -0
  21. data/app/controllers/concerns/.keep +0 -0
  22. data/app/controllers/editor_controller.rb +5 -0
  23. data/app/controllers/source_codes_controller.rb +106 -0
  24. data/app/helpers/application_helper.rb +2 -0
  25. data/app/helpers/editor_helper.rb +2 -0
  26. data/app/mailers/.keep +0 -0
  27. data/app/models/.keep +0 -0
  28. data/app/models/concerns/.keep +0 -0
  29. data/app/models/source_code.rb +49 -0
  30. data/app/views/editor/index.html.erb +23 -0
  31. data/app/views/layouts/application.html.erb +15 -0
  32. data/bin/bundle +3 -0
  33. data/bin/rails +4 -0
  34. data/bin/rake +4 -0
  35. data/bin/smalruby-editor +80 -0
  36. data/config/application.rb +16 -0
  37. data/config/boot.rb +17 -0
  38. data/config/database.yml.mysql2 +48 -0
  39. data/config/database.yml.sqlite3 +31 -0
  40. data/config/database.yml.travis +5 -0
  41. data/config/environment.rb +5 -0
  42. data/config/environments/development.rb +30 -0
  43. data/config/environments/production.rb +86 -0
  44. data/config/environments/standalone.rb +16 -0
  45. data/config/environments/test.rb +46 -0
  46. data/config/initializers/backtrace_silencers.rb +9 -0
  47. data/config/initializers/filter_parameter_logging.rb +4 -0
  48. data/config/initializers/inflections.rb +16 -0
  49. data/config/initializers/mime_types.rb +5 -0
  50. data/config/initializers/secret_token.rb +17 -0
  51. data/config/initializers/session_store.rb +4 -0
  52. data/config/initializers/wrap_parameters.rb +15 -0
  53. data/config/locales/en.yml +23 -0
  54. data/config/routes.rb +68 -0
  55. data/config/unicorn.rb +23 -0
  56. data/config.ru +4 -0
  57. data/db/migrate/20131216121603_create_source_codes.rb +9 -0
  58. data/db/migrate/20131219045113_add_filename_to_source_code.rb +5 -0
  59. data/db/schema.rb +23 -0
  60. data/db/seeds.rb +7 -0
  61. data/lib/assets/.keep +0 -0
  62. data/lib/smalruby_editor/version.rb +3 -0
  63. data/lib/smalruby_editor.rb +46 -0
  64. data/lib/tasks/.keep +0 -0
  65. data/lib/tasks/gem.rake +10 -0
  66. data/lib/tasks/rspec.rake +16 -0
  67. data/lib/tasks/rubocop.rake +3 -0
  68. data/log/.keep +0 -0
  69. data/public/404.html +58 -0
  70. data/public/422.html +58 -0
  71. data/public/500.html +57 -0
  72. data/public/assets/application-759ce4d1ac1e0e3991e6d350c8f98fc5.js +5267 -0
  73. data/public/assets/application-759ce4d1ac1e0e3991e6d350c8f98fc5.js.gz +0 -0
  74. data/public/assets/application-f51ea0e777d97f12a8ce84308f31eb57.css +4791 -0
  75. data/public/assets/application-f51ea0e777d97f12a8ce84308f31eb57.css.gz +0 -0
  76. data/public/assets/favicon-c7ae857bb9d06de8742ae2d337157e83.ico +0 -0
  77. data/public/assets/loading-e8e6dd7833131c92a6c3b9c8ccc6a6ac.gif +0 -0
  78. data/public/assets/manifest-f86249f9779f8f4d7c8fc148e4361b4f.json +1 -0
  79. data/public/assets/progressbar-82023a146fba2a0f6d925629ed2b09c5.gif +0 -0
  80. data/public/favicon.ico +0 -0
  81. data/public/fonts/FontAwesome.otf +0 -0
  82. data/public/fonts/fontawesome-webfont.eot +0 -0
  83. data/public/fonts/fontawesome-webfont.ttf +0 -0
  84. data/public/fonts/fontawesome-webfont.woff +0 -0
  85. data/public/robots.txt +5 -0
  86. data/smalruby-editor.gemspec +81 -0
  87. data/spec/acceptance/readme.md +3 -0
  88. data/spec/acceptance/standalone/save.feature +32 -0
  89. data/spec/acceptance/text_editor/base.feature +24 -0
  90. data/spec/acceptance/text_editor/check.feature +25 -0
  91. data/spec/acceptance/text_editor/load.feature +81 -0
  92. data/spec/acceptance/text_editor/save.feature +34 -0
  93. data/spec/controllers/editor_controller_spec.rb +12 -0
  94. data/spec/controllers/source_codes_controller_spec.rb +469 -0
  95. data/spec/fixtures/files/01.rb +57 -0
  96. data/spec/fixtures/files/favicon.ico +0 -0
  97. data/spec/helpers/editor_helper_spec.rb +14 -0
  98. data/spec/lib/smalruby_editor_spec.rb +66 -0
  99. data/spec/models/source_code_spec.rb +55 -0
  100. data/spec/spec_helper.rb +156 -0
  101. data/spec/steps/ace_steps.rb +59 -0
  102. data/spec/steps/global_variable.rb +39 -0
  103. data/spec/steps/text_editor_steps.rb +183 -0
  104. data/spec/support/assets.rb +18 -0
  105. data/spec/support/capybara.rb +17 -0
  106. data/spec/support/env.rb +15 -0
  107. data/spec/turnip_helper.rb +2 -0
  108. data/vendor/assets/javascripts/.keep +0 -0
  109. data/vendor/assets/stylesheets/.keep +0 -0
  110. metadata +407 -0
@@ -0,0 +1,46 @@
1
+ require 'smalruby_editor/version'
2
+
3
+ module SmalrubyEditor
4
+ def create_home_directory(home_dir = nil)
5
+ if home_dir.blank?
6
+ path = ENV['SMALRUBY_EDITOR_HOME'] || '~/.smalruby-editor'
7
+ home_dir = Pathname(path).expand_path
8
+ end
9
+ create_under_home_directories(home_dir)
10
+ create_database_yml(home_dir)
11
+ home_dir
12
+ end
13
+ module_function :create_home_directory
14
+
15
+ class << self
16
+ private
17
+
18
+ def create_under_home_directories(home_dir)
19
+ dirs = %w(log db config
20
+ tmp/cache tmp/pids tmp/sessions tmp/sockets).map { |s|
21
+ home_dir.join(s)
22
+ }
23
+ dirs.each do |dir|
24
+ FileUtils.mkdir_p(dir)
25
+ end
26
+ end
27
+
28
+ DATABASE_YML_TEMPLATE = <<-EOS
29
+ standalone:
30
+ adapter: sqlite3
31
+ database: %db_path%
32
+ pool: 5
33
+ timeout: 5000
34
+ EOS
35
+
36
+ def create_database_yml(home_dir)
37
+ database_yml_path = home_dir.join('config', 'database.yml')
38
+ db_path = home_dir.join('db', 'standalone.sqlite3')
39
+ unless File.exist?(database_yml_path)
40
+ File.open(database_yml_path, 'w') do |f|
41
+ f.write(DATABASE_YML_TEMPLATE.gsub(/%db_path%/, db_path.to_s))
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
data/lib/tasks/.keep ADDED
File without changes
@@ -0,0 +1,10 @@
1
+ require 'bundler/gem_tasks'
2
+
3
+ task 'assets:precompile:standalone' do
4
+ Rails.env = ENV['RAILS_ENV'] = 'standalone'
5
+ Rake::Task['assets:precompile'].invoke
6
+ end
7
+
8
+ task 'build' => ['assets:clobber', 'assets:precompile:standalone']
9
+
10
+
@@ -0,0 +1,16 @@
1
+ begin
2
+ if defined? RSpec # otherwise fails on non-live environments
3
+ task(:spec).clear
4
+ desc "Run all specs/features in spec directory"
5
+ RSpec::Core::RakeTask.new(:spec => 'db:test:prepare') do |t|
6
+ t.pattern = './spec/{,**/}*{_spec.rb,.feature}'
7
+ end
8
+
9
+ namespace :spec do
10
+ desc "Run the code examples in spec/acceptance"
11
+ RSpec::Core::RakeTask.new(:acceptance => 'db:test:prepare') do |t|
12
+ t.pattern = './spec/acceptance/{,**/}*.feature'
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,3 @@
1
+ task :rubocop do
2
+ sh 'bundle exec rubocop --rails app lib bin config spec'
3
+ end
data/log/.keep ADDED
File without changes
data/public/404.html ADDED
@@ -0,0 +1,58 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/404.html -->
52
+ <div class="dialog">
53
+ <h1>The page you were looking for doesn't exist.</h1>
54
+ <p>You may have mistyped the address or the page may have moved.</p>
55
+ </div>
56
+ <p>If you are the application owner check the logs for more information.</p>
57
+ </body>
58
+ </html>
data/public/422.html ADDED
@@ -0,0 +1,58 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/422.html -->
52
+ <div class="dialog">
53
+ <h1>The change you wanted was rejected.</h1>
54
+ <p>Maybe you tried to change something you didn't have access to.</p>
55
+ </div>
56
+ <p>If you are the application owner check the logs for more information.</p>
57
+ </body>
58
+ </html>
data/public/500.html ADDED
@@ -0,0 +1,57 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/500.html -->
52
+ <div class="dialog">
53
+ <h1>We're sorry, but something went wrong.</h1>
54
+ </div>
55
+ <p>If you are the application owner check the logs for more information.</p>
56
+ </body>
57
+ </html>