This repository has been archived by the owner on Aug 29, 2022. It is now read-only.
forked from companygardener/land
-
Notifications
You must be signed in to change notification settings - Fork 0
v1 #1
Open
spacechurro
wants to merge
1
commit into
master
Choose a base branch
from
v1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
v1 #1
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
appraise "rails-5.0" do | ||
gem "activerecord", "~> 5.0.0" | ||
end | ||
|
||
appraise "rails-5.1" do | ||
gem "activerecord", "~> 5.1.0" | ||
end | ||
|
||
appraise "rails-5.2" do | ||
gem "activerecord", "~> 5.2.0" | ||
end | ||
|
||
appraise "rails-6.0" do | ||
gem "activerecord", "~> 6.0.0" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Changelog | ||
|
||
See README.md before updating this file. | ||
|
||
## 0.1.0 | ||
* Initial release |
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,20 @@ | ||
source 'https://rubygems.org' | ||
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | ||
|
||
# Declare your gem's dependencies in land.gemspec. | ||
# Bundler will treat runtime dependencies like base dependencies, and | ||
# development dependencies will be added by default to the :development group. | ||
gemspec | ||
|
||
# Declare any dependencies that are still in development here instead of in | ||
# your gemspec. These might include edge Rails or gems from your path or | ||
# Git. Remember to move these dependencies to your gemspec before releasing | ||
# your gem to rubygems.org. | ||
|
||
# gem "pry", github: "pry/pry" | ||
|
||
group :development, :test do | ||
gem "combustion" | ||
gem "pry-rails" | ||
gem "simplecov", require: false | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2020 Erik Peterson | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
Some code originated from github.com/enova/landable | ||
Copyright 2013 Enova International |
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,55 @@ | ||
# Land | ||
Land is a clickstream tracker for Rails applications. It will track visits, pageviews, marketing attribution and more. | ||
|
||
## Installation | ||
Add this line to your application's Gemfile: | ||
|
||
```ruby | ||
gem 'land' | ||
``` | ||
|
||
And then execute: | ||
|
||
$ bundle install | ||
|
||
Or, install it yourself: | ||
|
||
$ gem install land | ||
|
||
To copy migrations to db/migrate run: | ||
|
||
$ rails land:install:migrations | ||
|
||
## Configuration | ||
|
||
Install with: | ||
|
||
$ rails g land:install | ||
|
||
Then edit `config/initializers/land.rb`. | ||
|
||
## Development | ||
|
||
After checking out the repo, run `bin/setup` to install dependencies, create database, and confirm test suite is working. You can also run `rails console` for an interactive prompt that will allow you to experiment. | ||
|
||
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). | ||
|
||
To start a console run `bin/rails console` or `rails c` | ||
|
||
## Testing | ||
|
||
Land uses a gem called __appraisal__ to test against multiple versions of Rails. Another gem, __combustion__ provides a minimal environment to run Rails. | ||
|
||
Setup your database using `rails db:drop db:create db:migrate`. | ||
|
||
To run the test suite against all versions of rails run `rake` or `appraisal rspec`. | ||
To run the test suite against just the latest version of rails run `rspec`. | ||
|
||
[Appraisal](https://github.com/thoughtbot/appraisal) | [Combustion](https://github.com/pat/combustion) | ||
|
||
## Contributing | ||
|
||
Bug reports and pull requests are welcome on GitHub at https://github.com/companygardener/land. | ||
|
||
## License | ||
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). |
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,61 @@ | ||
begin | ||
require "bundler/setup" | ||
require "bundler/gem_tasks" | ||
rescue LoadError | ||
puts 'You must `gem install bundler` and `bundle install` to run rake tasks' | ||
end | ||
|
||
require 'lookup_by' | ||
require "combustion" | ||
|
||
Combustion::Application.configure_for_combustion | ||
Combustion::Application.load_tasks | ||
|
||
if defined?(ActiveRecord) | ||
ActiveRecord::Base.schema_format = :sql | ||
end | ||
|
||
require "rspec/core/rake_task" | ||
RSpec::Core::RakeTask.new(:spec) | ||
|
||
require 'rdoc/task' | ||
|
||
RDoc::Task.new(:rdoc) do |rdoc| | ||
rdoc.rdoc_dir = 'rdoc' | ||
rdoc.title = 'Land' | ||
rdoc.options << '--line-numbers' | ||
rdoc.rdoc_files.include('README.md') | ||
rdoc.rdoc_files.include('lib/**/*.rb') | ||
end | ||
|
||
# Lifted from appraisal/task to avoid deprecated clutter. | ||
desc "Run the given task for all appraisals" | ||
task :appraisal do | ||
ARGV.shift | ||
exec "bundle exec appraisal rake #{ARGV.join(' ')}" | ||
end | ||
|
||
if !ENV["APPRAISAL_INITIALIZED"] && !ENV["TRAVIS"] | ||
task default: :appraisal | ||
else | ||
task default: :spec | ||
end | ||
|
||
# Clean up some clutter in `rake -T`. | ||
%w[ | ||
app:template | ||
app:update | ||
restart | ||
].each { |name| Rake::Task[name].clear } | ||
|
||
%w[ | ||
clean | ||
clobber_rdoc | ||
install:local | ||
log:clear | ||
rerdoc | ||
secret | ||
time:zones | ||
tmp:clear | ||
tmp:create | ||
].each { |name| Rake::Task[name].clear_comments } |
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 @@ | ||
- Add support for circle ci |
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,5 @@ | ||
module Land | ||
module Helper | ||
attr_reader :land | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module Land | ||
class ApplicationJob < ActiveJob::Base | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This class needed? |
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Land | ||
class AdGroup < ApplicationRecord | ||
include TableName | ||
|
||
lookup_by :ad_group, cache: 50, find_or_create: true | ||
|
||
has_many :attributions | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Land | ||
class AdType < ApplicationRecord | ||
include TableName | ||
|
||
lookup_by :ad_type, cache: 50, find_or_create: true | ||
|
||
has_many :attributions | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Land | ||
class App < ApplicationRecord | ||
include TableName | ||
|
||
lookup_by :app, cache: 50, find_or_create: true | ||
|
||
has_many :attributions | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Land | ||
class BidMatchType < ApplicationRecord | ||
include TableName | ||
|
||
lookup_by :bid_match_type, cache: 50, find_or_create: true | ||
|
||
has_many :attributions | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Land | ||
class Browser < ApplicationRecord | ||
include TableName | ||
|
||
lookup_by :browser, cache: 50, find_or_create: true | ||
|
||
has_many :user_agents | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module Land | ||
class Campaign < ApplicationRecord | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove empty line |
||
include TableName | ||
|
||
lookup_by :campaign, cache: 50, find_or_create: true | ||
|
||
has_many :attributions | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Land | ||
class Content < ApplicationRecord | ||
include TableName | ||
|
||
lookup_by :content, cache: 50, find_or_create: true | ||
|
||
has_many :attributions | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Land | ||
class Creative < ApplicationRecord | ||
include TableName | ||
|
||
lookup_by :creative, cache: 50, find_or_create: true | ||
|
||
has_many :attributions | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Land | ||
class Device < ApplicationRecord | ||
include TableName | ||
|
||
lookup_by :device, cache: 50, find_or_create: true | ||
|
||
has_many :user_agents | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Land | ||
class DeviceType < ApplicationRecord | ||
include TableName | ||
|
||
lookup_by :device_type, cache: 50, find_or_create: true | ||
|
||
has_many :attributions | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Land | ||
class Domain < ApplicationRecord | ||
include TableName | ||
|
||
lookup_by :domain, cache: 50, find_or_create: true, allow_blank: true | ||
|
||
has_many :referers | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Land | ||
class EventType < ApplicationRecord | ||
include TableName | ||
|
||
lookup_by :event_type, cache: 100 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only this one isn't |
||
|
||
has_many :events | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Land | ||
class Experiment < ApplicationRecord | ||
include TableName | ||
|
||
lookup_by :experiment, cache: 50, find_or_create: true | ||
|
||
has_many :attributions | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Land | ||
class HttpMethod < ApplicationRecord | ||
include TableName | ||
|
||
lookup_by :http_method, cache: 50, find_or_create: true | ||
|
||
has_many :pageviews | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Land | ||
class Keyword < ApplicationRecord | ||
include TableName | ||
|
||
lookup_by :keyword, cache: 50, find_or_create: true | ||
|
||
has_many :attributions | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Land | ||
class MatchType < ApplicationRecord | ||
include TableName | ||
|
||
lookup_by :match_type, cache: 50, find_or_create: true | ||
|
||
has_many :attributions | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Land | ||
class Medium < ApplicationRecord | ||
include TableName | ||
|
||
lookup_by :medium, cache: 50, find_or_create: true | ||
|
||
has_many :attributions | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Land | ||
class MimeType < ApplicationRecord | ||
include TableName | ||
|
||
lookup_by :mime_type, cache: 50, find_or_create: true | ||
|
||
has_many :pageviews | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Land | ||
class Network < ApplicationRecord | ||
include TableName | ||
|
||
lookup_by :network, cache: 50, find_or_create: true | ||
|
||
has_many :attributions | ||
end | ||
end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version number doesn't match
VERSION = '0.1.2'
later on -- let's sync up or update here?