ambert-simplekiss 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
@@ -0,0 +1,21 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+
16
+ ## PROJECT::GENERAL
17
+ coverage
18
+ rdoc
19
+ pkg
20
+
21
+ ## PROJECT::SPECIFIC
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2010 Jamie Lawrence. See LICENSE for details.
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,49 @@
1
+
2
+ = Ambert's fork of simplekiss
3
+
4
+ This is a simple library to add KISSmetrics to your layouts. It is configured using a YAML file.
5
+
6
+ == Install
7
+
8
+ gem install simplekiss
9
+
10
+ == Configure
11
+
12
+ Create a kissmetrics.yml file in your app's config/ dir
13
+
14
+ #KISSmetrics configuration file.
15
+ ---
16
+ apikey: <enter your api key here>
17
+
18
+ <controller>:
19
+ <action>: 'kissmetrics step title'
20
+ <another action>: 'kissmetrics step title'
21
+
22
+ # Example usage
23
+ user:
24
+ new: 'Visit signup page'
25
+ show: 'Viewed account page'
26
+ post:
27
+ new: 'Create a new post'
28
+
29
+ This allows you the customise the name of the action based on the controller and action being called
30
+
31
+ == Adding KISSmetrics to your layout
32
+
33
+ Simply add this to the end of your layout, preferably the last thing before <\body>
34
+
35
+ <%= kissmetrics if Rails.env == 'production' %>
36
+
37
+ By default, if an entry isn't found '<controller name>/<action name>' is sent to KISSmetrics instead.
38
+ If you want to turn off this behaviour, to stop polluting you stats with every page:
39
+
40
+ <%= kissmetrics(use_defaults=>false) if Rails.env == 'production' %>
41
+
42
+
43
+ == TODO/Feedback
44
+ * Tests: yeah, I know. Feel free to help me out here
45
+
46
+
47
+ == Copyright
48
+
49
+ Copyright (c) 2010 Jamie Lawrence. See LICENSE for details (MIT licence).
@@ -0,0 +1,53 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "simplekiss"
8
+ gem.summary = "A simple library for adding KISSmetrics to your pages"
9
+ gem.description = "A simple library which adds KISSMetrics javascript to your pages, based on a YAML config file"
10
+ gem.email = "jamie@shutterscouts.com"
11
+ gem.homepage = "http://github.com/hopeless/simplekiss"
12
+ gem.authors = ["Jamie Lawrence"]
13
+ gem.files.include %w(rails/init.rb)
14
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
15
+ end
16
+ Jeweler::GemcutterTasks.new
17
+ rescue LoadError
18
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
19
+ end
20
+
21
+ require 'rake/testtask'
22
+ Rake::TestTask.new(:test) do |test|
23
+ test.libs << 'lib' << 'test'
24
+ test.pattern = 'test/**/test_*.rb'
25
+ test.verbose = true
26
+ end
27
+
28
+ begin
29
+ require 'rcov/rcovtask'
30
+ Rcov::RcovTask.new do |test|
31
+ test.libs << 'test'
32
+ test.pattern = 'test/**/test_*.rb'
33
+ test.verbose = true
34
+ end
35
+ rescue LoadError
36
+ task :rcov do
37
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
38
+ end
39
+ end
40
+
41
+ task :test => :check_dependencies
42
+
43
+ task :default => :test
44
+
45
+ require 'rake/rdoctask'
46
+ Rake::RDocTask.new do |rdoc|
47
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
48
+
49
+ rdoc.rdoc_dir = 'rdoc'
50
+ rdoc.title = "simplekiss #{version}"
51
+ rdoc.rdoc_files.include('README*')
52
+ rdoc.rdoc_files.include('lib/**/*.rb')
53
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.2.0
@@ -0,0 +1,58 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{ambert-simplekiss}
8
+ s.version = "0.2.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Ambert Ho", "Jamie Lawrence"]
12
+ s.date = %q{2010-09-15}
13
+ s.description = %q{A simple library which adds KISSMetrics javascript to your pages, based on a YAML config file}
14
+ s.email = %q{ambertch@gmail.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".gitignore",
22
+ "LICENSE",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "example_kissmetrics.yml",
27
+ "lib/simplekiss.rb",
28
+ "nbproject/private/config.properties",
29
+ "nbproject/private/private.properties",
30
+ "nbproject/private/rake-d.txt",
31
+ "nbproject/project.properties",
32
+ "nbproject/project.xml",
33
+ "rails/init.rb",
34
+ "ambert-simplekiss.gemspec",
35
+ "test/helper.rb",
36
+ "test/test_simplekiss.rb"
37
+ ]
38
+ s.homepage = %q{http://github.com/ambertch/simplekiss}
39
+ s.rdoc_options = ["--charset=UTF-8"]
40
+ s.require_paths = ["lib"]
41
+ s.rubygems_version = %q{1.3.5}
42
+ s.summary = %q{A simple library for adding KISSmetrics to your pages}
43
+ s.test_files = [
44
+ "test/helper.rb",
45
+ "test/test_simplekiss.rb"
46
+ ]
47
+
48
+ if s.respond_to? :specification_version then
49
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
50
+ s.specification_version = 3
51
+
52
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
53
+ else
54
+ end
55
+ else
56
+ end
57
+ end
58
+
@@ -0,0 +1,14 @@
1
+ #KISSmetrics configuration file.
2
+ ---
3
+ apikey: <enter your api key here>
4
+
5
+ <controller>:
6
+ <action>: 'kissmetrics step title'
7
+ <another action>: 'kissmetrics step title'
8
+
9
+ # Example usage
10
+ user:
11
+ new: 'Visit signup page'
12
+ show: 'Viewed account page'
13
+ post:
14
+ new: 'Create a new post'
@@ -0,0 +1,18 @@
1
+ module SimpleKiss
2
+ def kissmetrics(use_default = true)
3
+ controller_slugs = CONFIG[controller_name]
4
+ slug = controller_slugs[action_name] unless controller_slugs.nil?
5
+ slug ||= "#{controller_name}/#{action_name}" if use_default
6
+ apikey = CONFIG['apikey']
7
+
8
+ (slug) ?
9
+ " <script type=\"text/javascript\">
10
+ var KM_KEY = \"#{apikey}\";
11
+ document.write(unescape(\"%3Cscript src='\" + ((\"https:\" == document.location.protocol) ? \"https://s3.amazonaws.com/\" : \"http://\") + \"scripts.kissmetrics.com/t.js' type='text/javascript'%3E%3C/script%3E\"));
12
+ </script>
13
+ <script type=\"text/javascript\">
14
+ KM.record(\"#{slug}\")
15
+ </script>
16
+ " : ""
17
+ end
18
+ end
File without changes
@@ -0,0 +1,3 @@
1
+ file.reference.simplekiss-lib=/home/jamie/simplekiss/simplekiss/lib
2
+ file.reference.simplekiss-test=/home/jamie/simplekiss/simplekiss/test
3
+ platform.active=Ruby
@@ -0,0 +1,27 @@
1
+ build=Build gem
2
+ check_dependencies=Check that runtime and development dependencies are installed
3
+ check_dependencies\:development=Check that development dependencies are installed
4
+ check_dependencies\:runtime=Check that runtime dependencies are installed
5
+ clobber=
6
+ clobber_rdoc=Remove rdoc products
7
+ default=
8
+ gemcutter\:release=Release gem to Gemcutter
9
+ gemspec=Generate and validates gemspec
10
+ gemspec\:debug=Display the gemspec for debugging purposes
11
+ gemspec\:generate=Generates the gemspec, using version from VERSION
12
+ gemspec\:validate=Validates the gemspec
13
+ git\:release=Tag a release in Git
14
+ github\:release=Release Gem to GitHub
15
+ install=Install gem using sudo
16
+ rcov=
17
+ rdoc=Build the rdoc HTML Files
18
+ rdoc/index.html=
19
+ release=Release gem
20
+ rerdoc=Force a rebuild of the RDOC files
21
+ test=Run tests
22
+ version=Displays the current version
23
+ version\:bump\:major=Bump the gemspec by a major version.
24
+ version\:bump\:minor=Bump the gemspec by a minor version.
25
+ version\:bump\:patch=Bump the gemspec by a patch version.
26
+ version\:write=Writes out an explicit version. Respects the following environment variables, or defaults to 0: MAJOR, MINOR, PATCH. Also recognizes BUILD, which defaults to nil
27
+ version_required=
@@ -0,0 +1,9 @@
1
+ file.reference.simplekiss-lib=simplekiss/lib
2
+ file.reference.simplekiss-test=simplekiss/test
3
+ javac.classpath=
4
+ main.file=
5
+ platform.active=Ruby
6
+ source.encoding=UTF-8
7
+ src.dir=${file.reference.simplekiss-lib}
8
+ src.rails.dir=rails
9
+ test.src.dir=${file.reference.simplekiss-test}
@@ -0,0 +1,16 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project xmlns="http://www.netbeans.org/ns/project/1">
3
+ <type>org.netbeans.modules.ruby.rubyproject</type>
4
+ <configuration>
5
+ <data xmlns="http://www.netbeans.org/ns/ruby-project/1">
6
+ <name>SimpleKiss</name>
7
+ <source-roots>
8
+ <root id="src.rails.dir"/>
9
+ <root id="src.dir"/>
10
+ </source-roots>
11
+ <test-roots>
12
+ <root id="test.src.dir"/>
13
+ </test-roots>
14
+ </data>
15
+ </configuration>
16
+ </project>
@@ -0,0 +1,4 @@
1
+ require 'simplekiss'
2
+
3
+ ActionView::Base.send(:include, SimpleKiss)
4
+ SimpleKiss::CONFIG = YAML.load(File.open(Rails.root+'config/kissmetrics.yml'))
@@ -0,0 +1,9 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+
4
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
+ require 'simplekiss'
7
+
8
+ class Test::Unit::TestCase
9
+ end
@@ -0,0 +1,7 @@
1
+ require 'helper'
2
+
3
+ class TestSimplekiss < Test::Unit::TestCase
4
+ def test_something_for_real
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ambert-simplekiss
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 2
8
+ - 1
9
+ version: 0.2.1
10
+ platform: ruby
11
+ authors:
12
+ - Ambert Ho
13
+ - Jamie Lawrence
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-09-15 00:00:00 -07:00
19
+ default_executable:
20
+ dependencies: []
21
+
22
+ description: A simple library which adds KISSMetrics javascript to your pages, based on a YAML config file
23
+ email: ambertch@gmail.com
24
+ executables: []
25
+
26
+ extensions: []
27
+
28
+ extra_rdoc_files:
29
+ - LICENSE
30
+ - README.rdoc
31
+ files:
32
+ - .document
33
+ - .gitignore
34
+ - LICENSE
35
+ - README.rdoc
36
+ - Rakefile
37
+ - VERSION
38
+ - example_kissmetrics.yml
39
+ - lib/simplekiss.rb
40
+ - nbproject/private/config.properties
41
+ - nbproject/private/private.properties
42
+ - nbproject/private/rake-d.txt
43
+ - nbproject/project.properties
44
+ - nbproject/project.xml
45
+ - rails/init.rb
46
+ - ambert-simplekiss.gemspec
47
+ - test/helper.rb
48
+ - test/test_simplekiss.rb
49
+ has_rdoc: true
50
+ homepage: http://github.com/ambertch/simplekiss
51
+ licenses: []
52
+
53
+ post_install_message:
54
+ rdoc_options:
55
+ - --charset=UTF-8
56
+ require_paths:
57
+ - lib
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ segments:
63
+ - 0
64
+ version: "0"
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ segments:
70
+ - 0
71
+ version: "0"
72
+ requirements: []
73
+
74
+ rubyforge_project:
75
+ rubygems_version: 1.3.6
76
+ signing_key:
77
+ specification_version: 3
78
+ summary: A simple library for adding KISSmetrics to your pages
79
+ test_files:
80
+ - test/helper.rb
81
+ - test/test_simplekiss.rb