This repository has been archived by the owner on Aug 10, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
16 changed files
with
475 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,62 @@ | ||
export RUBYOPT="rubygems" | ||
export RUBYLIB="." | ||
rvm ruby-1.8.7-p174@analytical | ||
|
||
# Install bundler if it doesn't already exist | ||
# if ! command -v bundle > /dev/null ; then | ||
# gem install bundler | ||
# fi | ||
#!/usr/bin/env bash | ||
|
||
# This is an RVM Project .rvmrc file, used to automatically load the ruby | ||
# development environment upon cd'ing into the directory | ||
|
||
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional, | ||
# Only full ruby name is supported here, for short names use: | ||
# echo "rvm use 2.0.0" > .rvmrc | ||
environment_id="ruby-2.0.0-p353@analytical" | ||
|
||
# Uncomment the following lines if you want to verify rvm version per project | ||
# rvmrc_rvm_version="1.24.7 (master)" # 1.10.1 seems like a safe start | ||
# eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | __rvm_awk -F. '{print "[[ "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" ]]"}' )" || { | ||
# echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading." | ||
# return 1 | ||
# } | ||
|
||
# First we attempt to load the desired environment directly from the environment | ||
# file. This is very fast and efficient compared to running through the entire | ||
# CLI and selector. If you want feedback on which environment was used then | ||
# insert the word 'use' after --create as this triggers verbose mode. | ||
if [[ -d "${rvm_path:-$HOME/.rvm}/environments" | ||
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]] | ||
then | ||
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id" | ||
for __hook in "${rvm_path:-$HOME/.rvm}/hooks/after_use"* | ||
do | ||
if [[ -f "${__hook}" && -x "${__hook}" && -s "${__hook}" ]] | ||
then \. "${__hook}" || true | ||
fi | ||
done | ||
unset __hook | ||
if (( ${rvm_use_flag:=1} >= 2 )) # display only when forced | ||
then | ||
if [[ $- == *i* ]] # check for interactive shells | ||
then printf "%b" "Using: $(tput setaf 2 2>/dev/null)$GEM_HOME$(tput sgr0 2>/dev/null) | ||
" # show the user the ruby and gemset they are using in green | ||
else printf "%b" "Using: $GEM_HOME | ||
" # don't use colors in non-interactive shells | ||
fi | ||
fi | ||
else | ||
# If the environment file has not yet been created, use the RVM CLI to select. | ||
rvm --create "$environment_id" || { | ||
echo "Failed to create RVM environment '${environment_id}'." | ||
return 1 | ||
} | ||
fi | ||
|
||
# If you use bundler, this might be useful to you: | ||
# if [[ -s Gemfile ]] && { | ||
# ! builtin command -v bundle >/dev/null || | ||
# builtin command -v bundle | GREP_OPTIONS="" \grep $rvm_path/bin/bundle >/dev/null | ||
# } | ||
# then | ||
# printf "%b" "The rubygem 'bundler' is not installed. Installing it now.\n" | ||
# gem install bundler | ||
# fi | ||
# if [[ -s Gemfile ]] && builtin command -v bundle >/dev/null | ||
# then | ||
# bundle install | GREP_OPTIONS="" \grep -vE '^Using|Your bundle is complete' | ||
# fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
module Analytical | ||
module Modules | ||
class GoogleUniversal | ||
include Analytical::Modules::Base | ||
|
||
def initialize(options={}) | ||
super | ||
@tracking_command_location = :head_append | ||
end | ||
|
||
def init_javascript(location) | ||
init_location(location) do | ||
js = <<-HTML | ||
<!-- Analytical Init: Google Universal --> | ||
<script> | ||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | ||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | ||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | ||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | ||
ga('create', '#{options[:key]}', '#{options[:domain]}'); | ||
ga('send', 'pageview'); | ||
</script> | ||
HTML | ||
js | ||
end | ||
end | ||
|
||
def event(name, *args) | ||
data = args.first || {} | ||
data = data[:value] if data.is_a?(Hash) | ||
data_string = !data.nil? ? ", #{data}" : "" | ||
"_gaq.push(['_trackEvent', \"Event\", \"#{name}\"" + data_string + "]);" | ||
"ga('send', 'event', \"Event\", \"#{name}\"" + data_string + ");" | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
module Analytical | ||
module Modules | ||
class Mouseflow | ||
include Analytical::Modules::Base | ||
|
||
def initialize(options={}) | ||
super | ||
check_js_url | ||
@tracking_command_location = :body_append | ||
end | ||
|
||
def init_javascript(location) | ||
init_location(location) do | ||
js = <<-HTML | ||
<!-- Analytical Init: Mouseflow --> | ||
<script type="text/javascript"> | ||
var _mfq = _mfq || []; | ||
(function() { | ||
var mf = document.createElement("script"); mf.type = "text/javascript"; mf.async = true; | ||
mf.src = "#{options[:js_url]}"; | ||
document.getElementsByTagName("head")[0].appendChild(mf); | ||
})(); | ||
</script> | ||
HTML | ||
js | ||
end | ||
end | ||
|
||
private | ||
|
||
def check_js_url | ||
if options[:js_url].nil? | ||
raise "You didn't provide a js_url for mouseflow. " + | ||
"Add one to your analytical.yml file so Mouseflow will work." | ||
end | ||
end | ||
|
||
end | ||
end | ||
end |
Oops, something went wrong.