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.
- checksums.yaml +7 -0
- data/.gitignore +25 -0
- data/.rspec +4 -0
- data/.rubocop.yml +19 -0
- data/.ruby-version +1 -0
- data/.simplecov +7 -0
- data/.travis.yml +23 -0
- data/LEGAL +13 -0
- data/LICENSE +22 -0
- data/Procfile +1 -0
- data/README.rdoc +46 -0
- data/Rakefile +9 -0
- data/app/assets/images/.keep +0 -0
- data/app/assets/images/favicon.ico +0 -0
- data/app/assets/javascripts/application.js +21 -0
- data/app/assets/javascripts/editor.js.coffee.erb +139 -0
- data/app/assets/stylesheets/application.css +19 -0
- data/app/assets/stylesheets/editor.css.scss +19 -0
- data/app/assets/stylesheets/flatstrap-custom.css.scss +2 -0
- data/app/controllers/application_controller.rb +5 -0
- data/app/controllers/concerns/.keep +0 -0
- data/app/controllers/editor_controller.rb +5 -0
- data/app/controllers/source_codes_controller.rb +106 -0
- data/app/helpers/application_helper.rb +2 -0
- data/app/helpers/editor_helper.rb +2 -0
- data/app/mailers/.keep +0 -0
- data/app/models/.keep +0 -0
- data/app/models/concerns/.keep +0 -0
- data/app/models/source_code.rb +49 -0
- data/app/views/editor/index.html.erb +23 -0
- data/app/views/layouts/application.html.erb +15 -0
- data/bin/bundle +3 -0
- data/bin/rails +4 -0
- data/bin/rake +4 -0
- data/bin/smalruby-editor +80 -0
- data/config/application.rb +16 -0
- data/config/boot.rb +17 -0
- data/config/database.yml.mysql2 +48 -0
- data/config/database.yml.sqlite3 +31 -0
- data/config/database.yml.travis +5 -0
- data/config/environment.rb +5 -0
- data/config/environments/development.rb +30 -0
- data/config/environments/production.rb +86 -0
- data/config/environments/standalone.rb +16 -0
- data/config/environments/test.rb +46 -0
- data/config/initializers/backtrace_silencers.rb +9 -0
- data/config/initializers/filter_parameter_logging.rb +4 -0
- data/config/initializers/inflections.rb +16 -0
- data/config/initializers/mime_types.rb +5 -0
- data/config/initializers/secret_token.rb +17 -0
- data/config/initializers/session_store.rb +4 -0
- data/config/initializers/wrap_parameters.rb +15 -0
- data/config/locales/en.yml +23 -0
- data/config/routes.rb +68 -0
- data/config/unicorn.rb +23 -0
- data/config.ru +4 -0
- data/db/migrate/20131216121603_create_source_codes.rb +9 -0
- data/db/migrate/20131219045113_add_filename_to_source_code.rb +5 -0
- data/db/schema.rb +23 -0
- data/db/seeds.rb +7 -0
- data/lib/assets/.keep +0 -0
- data/lib/smalruby_editor/version.rb +3 -0
- data/lib/smalruby_editor.rb +46 -0
- data/lib/tasks/.keep +0 -0
- data/lib/tasks/gem.rake +10 -0
- data/lib/tasks/rspec.rake +16 -0
- data/lib/tasks/rubocop.rake +3 -0
- data/log/.keep +0 -0
- data/public/404.html +58 -0
- data/public/422.html +58 -0
- data/public/500.html +57 -0
- data/public/assets/application-759ce4d1ac1e0e3991e6d350c8f98fc5.js +5267 -0
- data/public/assets/application-759ce4d1ac1e0e3991e6d350c8f98fc5.js.gz +0 -0
- data/public/assets/application-f51ea0e777d97f12a8ce84308f31eb57.css +4791 -0
- data/public/assets/application-f51ea0e777d97f12a8ce84308f31eb57.css.gz +0 -0
- data/public/assets/favicon-c7ae857bb9d06de8742ae2d337157e83.ico +0 -0
- data/public/assets/loading-e8e6dd7833131c92a6c3b9c8ccc6a6ac.gif +0 -0
- data/public/assets/manifest-f86249f9779f8f4d7c8fc148e4361b4f.json +1 -0
- data/public/assets/progressbar-82023a146fba2a0f6d925629ed2b09c5.gif +0 -0
- data/public/favicon.ico +0 -0
- data/public/fonts/FontAwesome.otf +0 -0
- data/public/fonts/fontawesome-webfont.eot +0 -0
- data/public/fonts/fontawesome-webfont.ttf +0 -0
- data/public/fonts/fontawesome-webfont.woff +0 -0
- data/public/robots.txt +5 -0
- data/smalruby-editor.gemspec +81 -0
- data/spec/acceptance/readme.md +3 -0
- data/spec/acceptance/standalone/save.feature +32 -0
- data/spec/acceptance/text_editor/base.feature +24 -0
- data/spec/acceptance/text_editor/check.feature +25 -0
- data/spec/acceptance/text_editor/load.feature +81 -0
- data/spec/acceptance/text_editor/save.feature +34 -0
- data/spec/controllers/editor_controller_spec.rb +12 -0
- data/spec/controllers/source_codes_controller_spec.rb +469 -0
- data/spec/fixtures/files/01.rb +57 -0
- data/spec/fixtures/files/favicon.ico +0 -0
- data/spec/helpers/editor_helper_spec.rb +14 -0
- data/spec/lib/smalruby_editor_spec.rb +66 -0
- data/spec/models/source_code_spec.rb +55 -0
- data/spec/spec_helper.rb +156 -0
- data/spec/steps/ace_steps.rb +59 -0
- data/spec/steps/global_variable.rb +39 -0
- data/spec/steps/text_editor_steps.rb +183 -0
- data/spec/support/assets.rb +18 -0
- data/spec/support/capybara.rb +17 -0
- data/spec/support/env.rb +15 -0
- data/spec/turnip_helper.rb +2 -0
- data/vendor/assets/javascripts/.keep +0 -0
- data/vendor/assets/stylesheets/.keep +0 -0
- 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
|
data/lib/tasks/gem.rake
ADDED
@@ -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
|
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>
|