searchjoy 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1b5b37420e741afe05925396f8b0b80ea561ae1b
4
- data.tar.gz: 54799f92c58b23b70520f1ce02edf1e950992b22
3
+ metadata.gz: 862d1746537799a5bafb78e34d80cada1c14de5c
4
+ data.tar.gz: 83fbc177bc299282edae186d4147cf285d7ad4fe
5
5
  SHA512:
6
- metadata.gz: 6dbb2d7291d0378747674ee6a8d2bc5ab0915fa6bed0958845818406f83b58dfddd7766bfed084c4ed85c62c2b384bcecbfab3e2410a052fb95773b7ac524dd7
7
- data.tar.gz: 7908a81eec008402c9c61392f5e5a17387297da415302f846bc5742f8a17c34c5c15fbfb7bc1f527f48dcce307d9842eb4e20eebd3bb4b763c78f661916053cc
6
+ metadata.gz: '097becc8c6b70f079d66a5687c0db5fb7bc0ada6be6cf47ef2d33246d4ee908293dedcc62dd4ef37081e268fb8f94284c61c58b146e07b89cfa55a5ea6e2b579'
7
+ data.tar.gz: f13fa9f9cdd05d088fd5eacb72ca466eaa387927fe159276d2d4705d54d19e324c8986666b5aa9f4b080e0cf9b8c7e6b8ee9d30d79cdb6bf96b0c418351276d9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.2.1
2
+
3
+ - Added `query_url` option
4
+
1
5
  ## 0.2.0
2
6
 
3
7
  - Fixed error with Rails 5
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Search analytics made easy
4
4
 
5
- [See it in action](http://searchjoy.herokuapp.com/)
5
+ [See it in action](https://searchjoy.herokuapp.com/)
6
6
 
7
7
  - view searches in real-time
8
8
  - track conversions week over week
@@ -119,7 +119,13 @@ Change the number of top searches shown with:
119
119
  Searchjoy.top_searches = 500 # defaults to 100
120
120
  ```
121
121
 
122
- Add additional info to the query in the live stream. [master]
122
+ Link to the search results [master]
123
+
124
+ ```ruby
125
+ Searchjoy.query_url = -> (search) { Rails.application.routes.url_helpers.items_path(q: search.query) }
126
+ ```
127
+
128
+ Add additional info to the query in the live stream.
123
129
 
124
130
  ```ruby
125
131
  Searchjoy.query_name = -> (search) { "#{search.query} #{search.city}" }
@@ -1,5 +1,7 @@
1
1
  module Searchjoy
2
2
  class SearchesController < ActionController::Base
3
+ protect_from_forgery with: :exception
4
+
3
5
  layout "searchjoy/application"
4
6
 
5
7
  http_basic_authenticate_with name: ENV["SEARCHJOY_USERNAME"], password: ENV["SEARCHJOY_PASSWORD"] if ENV["SEARCHJOY_PASSWORD"]
@@ -280,8 +280,7 @@
280
280
  }
281
281
  </style>
282
282
 
283
- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
284
- <%= javascript_include_tag "//www.google.com/jsapi", "chartkick" %>
283
+ <%= javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js", "https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.bundle.min.js", "chartkick" %>
285
284
  </head>
286
285
  <body>
287
286
  <div class="container">
@@ -3,7 +3,14 @@
3
3
  <td style="width: 15%;">
4
4
  <%= link_to search.search_type, overview_searches_path(search_type: search.search_type), class: "type-link type-link-#{@search_types.index(search.search_type)}" %>
5
5
  </td>
6
- <td><%= Searchjoy.query_name ? Searchjoy.query_name.call(search) : search.query %></td>
6
+ <td>
7
+ <% name = Searchjoy.query_name ? Searchjoy.query_name.call(search) : search.query %>
8
+ <% if Searchjoy.query_url %>
9
+ <%= link_to name, Searchjoy.query_url.call(search), target: "_blank" %>
10
+ <% else %>
11
+ <%= name %>
12
+ <% end %>
13
+ </td>
7
14
 
8
15
  <td style="width: 35%; color: #5cb85c;">
9
16
  <% if search.converted_at %>
@@ -1,3 +1,3 @@
1
1
  module Searchjoy
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
data/lib/searchjoy.rb CHANGED
@@ -20,6 +20,7 @@ module Searchjoy
20
20
  # conversion name
21
21
  mattr_accessor :conversion_name
22
22
  mattr_accessor :query_name
23
+ mattr_accessor :query_url
23
24
  end
24
25
 
25
26
  begin
data/searchjoy.gemspec CHANGED
@@ -18,8 +18,8 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "chartkick"
22
- spec.add_dependency "groupdate"
21
+ spec.add_dependency "chartkick", ">= 2"
22
+ spec.add_dependency "groupdate", ">= 3"
23
23
  spec.add_dependency "activerecord", ">= 4"
24
24
 
25
25
  spec.add_development_dependency "bundler"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: searchjoy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-06 00:00:00.000000000 Z
11
+ date: 2017-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chartkick
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: groupdate
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '3'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: activerecord
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  version: '0'
145
145
  requirements: []
146
146
  rubyforge_project:
147
- rubygems_version: 2.5.1
147
+ rubygems_version: 2.6.8
148
148
  signing_key:
149
149
  specification_version: 4
150
150
  summary: Search analytics made easy