aladdin 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/lib/aladdin/app.rb CHANGED
@@ -19,13 +19,7 @@ module Aladdin
19
19
  MARKDOWN_OPTIONS = {
20
20
  renderer: Aladdin::Render::HTML,
21
21
  layout_engine: :haml,
22
- no_intra_emphasis: true,
23
- tables: true,
24
- fenced_code_blocks: true,
25
- autolink: true,
26
- strikethrough: true,
27
- tables: true,
28
- }
22
+ }.merge MARKDOWN_EXTENSIONS
29
23
 
30
24
  class << self
31
25
  private
@@ -47,7 +41,7 @@ module Aladdin
47
41
  # @return [void]
48
42
  def configure_assets
49
43
  set :public_folder, Aladdin::PATHS.assets
50
- set :static_paths, Proc.new { Aladdin.config['static_paths'] }
44
+ set :static_paths, Proc.new { Aladdin.config[:static_paths] }
51
45
  end
52
46
 
53
47
  # Configures ZURB's compass to compile aladdin's scss assets.
@@ -29,7 +29,7 @@ module Aladdin
29
29
  when '--version', '-v'
30
30
  puts "Aladdin #{Aladdin::VERSION}"
31
31
  exit 0
32
- when '--help', '-h'
32
+ when nil, '--help', '-h'
33
33
  puts File.read USAGE
34
34
  exit 0
35
35
  else
@@ -1,4 +1,8 @@
1
1
  # ~*~ encoding: utf-8 ~*~
2
+ require 'active_support/core_ext/hash'
3
+ require 'json'
4
+ require 'aladdin/constants'
5
+
2
6
  module Aladdin
3
7
 
4
8
  # Raised when there is a configuration error.
@@ -14,14 +18,14 @@ module Aladdin
14
18
 
15
19
  # Default configuration options.
16
20
  DEFAULTS = {
17
- 'verify' => {
21
+ verify: {
18
22
  'bin' => 'make',
19
23
  'arg_prefix' => ''
20
24
  },
21
- 'title' => 'Lesson X',
22
- 'description' => 'This is a placeholder description. You should provide your own',
23
- 'categories' => [],
24
- 'static_paths' => %w(images)
25
+ title: 'Lesson X',
26
+ description: 'This is a placeholder description. You should provide your own',
27
+ categories: [],
28
+ static_paths: %w(images)
25
29
  }
26
30
 
27
31
  # Creates a new configuration from the file at the given path. Merges the
@@ -32,7 +36,8 @@ module Aladdin
32
36
  @path = File.expand_path FILE, root
33
37
  ensure_readable
34
38
  super nil
35
- merge! DEFAULTS.deep_merge ::JSON.parse File.read @path
39
+ newsets = ::JSON.parse File.read @path
40
+ merge! DEFAULTS.deep_merge newsets.symbolize_keys
36
41
  ensure_valid
37
42
  rescue ::JSON::JSONError => e
38
43
  raise ConfigError.new e.message
@@ -26,4 +26,14 @@ module Aladdin
26
26
  # File extension for solution files.
27
27
  SOLUTION_EXT = '.sol'
28
28
 
29
+ # Markdown extensions for Redcarpet
30
+ MARKDOWN_EXTENSIONS = {
31
+ no_intra_emphasis: true,
32
+ tables: true,
33
+ fenced_code_blocks: true,
34
+ autolink: true,
35
+ strikethrough: true,
36
+ tables: true,
37
+ }
38
+
29
39
  end
@@ -5,4 +5,5 @@ require 'redcarpet'
5
5
  require 'htmlentities'
6
6
  require 'sanitize'
7
7
 
8
- require 'aladdin/render/markdown'
8
+ require 'aladdin/support'
9
+ require 'aladdin/render/html'
File without changes
@@ -54,7 +54,7 @@ module Aladdin
54
54
  # FIXME: catch errors
55
55
  filename = SecureRandom.uuid
56
56
  IO.write(filename, @input)
57
- bin = File.join '..', Aladdin.config['verify']['bin']
57
+ bin = File.join '..', Aladdin.config[:verify]['bin']
58
58
  `#{bin} --id=#{@id} --input=#{filename}`
59
59
  IO.read 'genie-results.json'
60
60
  end
@@ -1,4 +1,4 @@
1
1
  module Aladdin
2
2
  # Version number.
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.7"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aladdin
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:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-27 00:00:00.000000000 Z
12
+ date: 2012-12-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
@@ -43,22 +43,6 @@ dependencies:
43
43
  - - ~>
44
44
  - !ruby/object:Gem::Version
45
45
  version: 3.2.3
46
- - !ruby/object:Gem::Dependency
47
- name: thin
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ~>
52
- - !ruby/object:Gem::Version
53
- version: '1.5'
54
- type: :runtime
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ~>
60
- - !ruby/object:Gem::Version
61
- version: '1.5'
62
46
  - !ruby/object:Gem::Dependency
63
47
  name: haml
64
48
  requirement: !ruby/object:Gem::Requirement
@@ -139,22 +123,6 @@ dependencies:
139
123
  - - ~>
140
124
  - !ruby/object:Gem::Version
141
125
  version: 2.0.3
142
- - !ruby/object:Gem::Dependency
143
- name: colorize
144
- requirement: !ruby/object:Gem::Requirement
145
- none: false
146
- requirements:
147
- - - ! '>='
148
- - !ruby/object:Gem::Version
149
- version: '0'
150
- type: :runtime
151
- prerelease: false
152
- version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
- requirements:
155
- - - ! '>='
156
- - !ruby/object:Gem::Version
157
- version: '0'
158
126
  - !ruby/object:Gem::Dependency
159
127
  name: activesupport
160
128
  requirement: !ruby/object:Gem::Requirement
@@ -269,7 +237,7 @@ files:
269
237
  - lib/aladdin/config.rb
270
238
  - lib/aladdin/constants.rb
271
239
  - lib/aladdin/render/error.rb
272
- - lib/aladdin/render/markdown.rb
240
+ - lib/aladdin/render/html.rb
273
241
  - lib/aladdin/render/sanitize.rb
274
242
  - lib/aladdin/render/templates/header.rb
275
243
  - lib/aladdin/render/templates/image.rb
@@ -361,6 +329,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
361
329
  - - ! '>='
362
330
  - !ruby/object:Gem::Version
363
331
  version: '0'
332
+ segments:
333
+ - 0
334
+ hash: 3977803358167524809
364
335
  requirements:
365
336
  - pygments, python's syntax highlighter
366
337
  rubyforge_project: