ace-helper 0.0.1 → 0.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 000571508f883b1d18234ff9fc3bb00cf9a701e7
4
- data.tar.gz: 410d58cee2abecc857df37d43e09d5314e9de866
3
+ metadata.gz: 49f728f7e22cc4ad0021de1b0b90dd6d072345c7
4
+ data.tar.gz: e86b624090d9200c425d61afbaa811bb67d00641
5
5
  SHA512:
6
- metadata.gz: 70c27ef8727ce40c772214856f2ca5938b8fc34c82e957b7dfd3af34e12f2bb512af322ed2a47862a0b6065407d479732597bfcb77cb4da913e625a2f90a6be4
7
- data.tar.gz: 04c9a81d7bb75c68b57132d135fc9a719791c8b09e2a69320956a0aa7e9ef037d56c6f5d1725d78574d44fe7cd760d6efb3dc4aa6f37c16454a44be3e87bc290
6
+ metadata.gz: 29608fa0c5e863d73c4fbb0c958caf8d6604b61d5a3fa1869f3664113fe241d0cc4046621f3ba3cb4e59c4f94d7d8190296e7464037737acc3a0f35829360721
7
+ data.tar.gz: 28c01bec27882f9c75535831d46be6ee5fc8a0f2960e2ea2b39f228e927ba4ca9f570b6221de2762ee4455f81dd32cf08ffeb32445b01caf473d9b54ab1fd2d6
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Ace::Helper
2
2
 
3
- TODO: Write a gem description
3
+ Ace helper add a ace-editor, as well properly javascript to your
4
+ webpage
5
+ (Well, since this is 0.0.1 version, it have some dirty things...)
4
6
 
5
7
  ## Installation
6
8
 
@@ -18,7 +20,33 @@ Or install it yourself as:
18
20
 
19
21
  ## Usage
20
22
 
21
- TODO: Write usage instructions here
23
+ in your helper.rb file use:
24
+
25
+ $ require 'ace/helper'
26
+
27
+ and use in your own functions:
28
+
29
+ include Ace::Helper::Builder
30
+
31
+ def create_ace(src, opt)
32
+ js = ace(src)
33
+ content_tag(:div, js, :id => opt[:id])
34
+ end
35
+
36
+ in your view files add ace, your mode and theme, as well the code
37
+
38
+ <%= javascript_include_tags "ace", "mode-coffee","worker-coffee","theme-monokai" %>
39
+ <%= create_ace "console.log('Hello World!')", :id => "coffee_editor" %>
40
+
41
+ in your css files add these parameters:
42
+
43
+ #coffee_editor{
44
+ position: absolute;
45
+ top: 0%;
46
+ bottom: 0%;
47
+ right: 0%;
48
+ left: 0%;
49
+ }
22
50
 
23
51
  ## Contributing
24
52
 
@@ -32,39 +32,6 @@ module Ace
32
32
  #}
33
33
  }
34
34
 
35
- COMMENT_MESSAGE = """# ======================================================================================
36
- # Hi, this is an ace editor integrated with terminal
37
- #
38
- # All previous posts in index page
39
- # show a way to use coffee-script language \/ \\
40
- # See old ones if you do not know anything \/ \\
41
- # \/_____\\
42
- # You can use coffee-script here to change the code below \/ \\
43
- # !Think in a way to make music! \/ \\
44
- # When done, you can use hotkeys to render or stop music: ------------
45
- # - Render audio: a A
46
- # - Mac: Command + Enter aaa AAA
47
- # - Linux / Windows: Ctrl + Enter aa aa------- AA AA
48
- # - Stop audio: aa aa AA AA
49
- # - Mac: Command + . aaa---aaa AAA---AAA
50
- # - Linux / Window: Ctrl + . aa aa AA AA
51
- # AA AA aa aa
52
- # Or you can use 'render' or 'stop' commands AA AA aa aa
53
- # with buttons above or type them in terminal aaaaaaaaaaaaaAAAAAAAAAAAAA
54
- # at your right side. 0 .25 0.5 .75 1
55
- # AAAAAAAAAAAAAaaaaaaaaaaaaa
56
- # If you find any issue, please contact me in: aaaaaaaaaaaaaAAAAAAAAAAAAAAA
57
- # https://github.com/jahpd/yaknowboutblogmusic/issues aaa aAA AAA
58
- # aaaaa aaAAA AAAAA
59
- # If you want to contribute with any code, fork it! aaaaaaa aaaAAAA AAAAAAA
60
- #
61
- # If you want to reply, some sugestion, critic
62
- # send email for xxx@yyyy.zzz
63
- # or join irc.freenode.net #labmacambira
64
-
65
- # Happy live-coding!
66
- # (DESTROY ME AND USE EDITOR!)
67
- # ======================================================================================\n"""
68
35
  end
69
36
  end
70
37
  end
@@ -11,7 +11,7 @@ module Ace
11
11
  # The javascript that runs:
12
12
  # - Audio client based on gibberish.js
13
13
  # - Ace editor with post code
14
- def ace(code_string)
14
+ def ace(code_string, &block)
15
15
  #string = hook_gac()
16
16
  string = hook_editor(MODE, THEME)
17
17
  string << hook_code(code_string)
@@ -33,7 +33,7 @@ module Ace
33
33
  end
34
34
 
35
35
  def hook_code(code_string)
36
- s = "#{COMMENT_MESSAGE}#{code_string}"
36
+ s = "#{code_string}"
37
37
  string = "editor.setValue '#{escape_javascript(s)}'\n"
38
38
  string << "console.log 'code script embeeded to editor!'\n"
39
39
  end
@@ -1,5 +1,5 @@
1
1
  module Ace
2
2
  module Helper
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ace-helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - jahpd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-07 00:00:00.000000000 Z
11
+ date: 2014-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler