javascript_safe_logger 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.
data/README.rdoc
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
== Rails 3.1 javascript asset for Paul Irish console.log wrapper
|
2
|
+
|
3
|
+
This gem makes a javascript log method available as a Rails 3.1 asset
|
4
|
+
|
5
|
+
* see {http://paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/}[http://paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/]
|
6
|
+
* see {https://github.com/paulirish/html5-boilerplate}[https://github.com/paulirish/html5-boilerplate]
|
7
|
+
|
8
|
+
== Usage
|
9
|
+
|
10
|
+
in your javascript
|
11
|
+
|
12
|
+
log('inside coolFunc', this, arguments);
|
13
|
+
// or simple
|
14
|
+
log('hello world!');
|
15
|
+
|
16
|
+
and in coffeescript
|
17
|
+
|
18
|
+
log 'inside coolFunc', this, arguments
|
19
|
+
# or simple
|
20
|
+
log 'hello world!'
|
21
|
+
|
22
|
+
|
23
|
+
== Install
|
24
|
+
|
25
|
+
1. Update the Gemfile in your rails project, add the following line
|
26
|
+
|
27
|
+
gem 'javascript_safe_logger'
|
28
|
+
|
29
|
+
2. Update the /app/assets/javascript/application.js file
|
30
|
+
|
31
|
+
A. Manually update the file, add this before other requires
|
32
|
+
|
33
|
+
//= require safe_logger
|
34
|
+
|
35
|
+
B. Or use the generator to update the application.js file
|
36
|
+
|
37
|
+
rails generate javascript_safe_logger
|
38
|
+
|
39
|
+
== License
|
40
|
+
|
41
|
+
Paul Irish released the javascript code with the {The Unlicense}[http://unlicense.org/] (aka: public domain),
|
42
|
+
so this gem is also released with the same license.
|
43
|
+
|
44
|
+
|
45
|
+
|
@@ -11,20 +11,11 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.summary = %q{
|
12
12
|
Rails 3.1 javascript asset for Paul Irish console.log wrapper
|
13
13
|
}
|
14
|
-
s.description =
|
15
|
-
Rails 3.1 javascript asset for Paul Irish console.log wrapper
|
16
|
-
|
17
|
-
http://paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
|
18
|
-
https://raw.github.com/paulirish/html5-boilerplate/master/js/plugins.js
|
19
|
-
|
20
|
-
add to your Gemfile and then include in your application.js
|
21
|
-
//= require safe_logger
|
22
|
-
|
23
|
-
usage: log('inside coolFunc', this, arguments);
|
24
|
-
}
|
25
|
-
|
14
|
+
s.description = File.open('README.rdoc') { |f| f.read }
|
26
15
|
s.rubyforge_project = "javascript_safe_logger"
|
27
16
|
|
17
|
+
s.add_dependency 'rails', '~> 3.1.0.rc'
|
18
|
+
|
28
19
|
s.files = `git ls-files`.split("\n")
|
29
20
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
30
21
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class JavascriptSafeLoggerGenerator < Rails::Generators::Base
|
2
|
+
|
3
|
+
def manifest
|
4
|
+
say " Adding safe_logger to javascript asset manifest file"
|
5
|
+
|
6
|
+
begin
|
7
|
+
update_application_js
|
8
|
+
rescue Exception => e
|
9
|
+
say " -> Unexpected Failure in JavascriptSafeLoggerGenerator", :red
|
10
|
+
say e
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def update_application_js
|
17
|
+
prepend_file "app/assets/javascripts/application.js", "//= require safe_logger\n"
|
18
|
+
end
|
19
|
+
end
|
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: javascript_safe_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 0
|
8
|
-
- 1
|
9
|
-
version: 0.0.1
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.2
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- Jesse House
|
@@ -14,11 +10,65 @@ autorequire:
|
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
12
|
|
17
|
-
date: 2011-06-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
13
|
+
date: 2011-06-25 00:00:00 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rails
|
17
|
+
prerelease: false
|
18
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
20
|
+
requirements:
|
21
|
+
- - ~>
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 3.1.0.rc
|
24
|
+
type: :runtime
|
25
|
+
version_requirements: *id001
|
26
|
+
description: |+
|
27
|
+
== Rails 3.1 javascript asset for Paul Irish console.log wrapper
|
28
|
+
|
29
|
+
This gem makes a javascript log method available as a Rails 3.1 asset
|
30
|
+
|
31
|
+
* see {http://paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/}[http://paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/]
|
32
|
+
* see {https://github.com/paulirish/html5-boilerplate}[https://github.com/paulirish/html5-boilerplate]
|
33
|
+
|
34
|
+
== Usage
|
35
|
+
|
36
|
+
in your javascript
|
37
|
+
|
38
|
+
log('inside coolFunc', this, arguments);
|
39
|
+
// or simple
|
40
|
+
log('hello world!');
|
41
|
+
|
42
|
+
and in coffeescript
|
43
|
+
|
44
|
+
log 'inside coolFunc', this, arguments
|
45
|
+
# or simple
|
46
|
+
log 'hello world!'
|
47
|
+
|
48
|
+
|
49
|
+
== Install
|
50
|
+
|
51
|
+
1. Update the Gemfile in your rails project, add the following line
|
52
|
+
|
53
|
+
gem 'javascript_safe_logger'
|
54
|
+
|
55
|
+
2. Update the /app/assets/javascript/application.js file
|
56
|
+
|
57
|
+
A. Manually update the file, add this before other requires
|
58
|
+
|
59
|
+
//= require safe_logger
|
60
|
+
|
61
|
+
B. Or use the generator to update the application.js file
|
62
|
+
|
63
|
+
rails generate javascript_safe_logger
|
64
|
+
|
65
|
+
== License
|
66
|
+
|
67
|
+
Paul Irish released the javascript code with the {The Unlicense}[http://unlicense.org/] (aka: public domain),
|
68
|
+
so this gem is also released with the same license.
|
69
|
+
|
70
|
+
|
71
|
+
|
22
72
|
email:
|
23
73
|
- jesse.house@gmail.com
|
24
74
|
executables: []
|
@@ -30,14 +80,16 @@ extra_rdoc_files: []
|
|
30
80
|
files:
|
31
81
|
- .gitignore
|
32
82
|
- Gemfile
|
83
|
+
- README.rdoc
|
33
84
|
- Rakefile
|
34
85
|
- javascript_safe_logger.gemspec
|
86
|
+
- lib/generators/javascript_safe_logger/USAGE
|
87
|
+
- lib/generators/javascript_safe_logger/javascript_safe_logger_generator.rb
|
35
88
|
- lib/javascript_safe_logger.rb
|
36
89
|
- lib/javascript_safe_logger/engine.rb
|
37
90
|
- lib/javascript_safe_logger/version.rb
|
38
91
|
- vendor/assets/javascripts/safe_logger/index.js
|
39
92
|
- vendor/assets/javascripts/safe_logger/log.js
|
40
|
-
has_rdoc: true
|
41
93
|
homepage: https://github.com/house9/javascript_safe_logger
|
42
94
|
licenses: []
|
43
95
|
|
@@ -51,21 +103,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
51
103
|
requirements:
|
52
104
|
- - ">="
|
53
105
|
- !ruby/object:Gem::Version
|
54
|
-
segments:
|
55
|
-
- 0
|
56
106
|
version: "0"
|
57
107
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
108
|
none: false
|
59
109
|
requirements:
|
60
110
|
- - ">="
|
61
111
|
- !ruby/object:Gem::Version
|
62
|
-
segments:
|
63
|
-
- 0
|
64
112
|
version: "0"
|
65
113
|
requirements: []
|
66
114
|
|
67
115
|
rubyforge_project: javascript_safe_logger
|
68
|
-
rubygems_version: 1.
|
116
|
+
rubygems_version: 1.8.5
|
69
117
|
signing_key:
|
70
118
|
specification_version: 3
|
71
119
|
summary: Rails 3.1 javascript asset for Paul Irish console.log wrapper
|