elasticrepo 0.0.3 → 0.0.4

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: 56603fcfd136f7504f3987047358e24d2987f5d2
4
- data.tar.gz: c1be2af01694f38c4e3173d632a126369370c948
3
+ metadata.gz: b27a7c15f78466f02c2b2b117beaf7ed865d69f8
4
+ data.tar.gz: d1d654a66b39aaa4e12084bbb923b095b4856e3c
5
5
  SHA512:
6
- metadata.gz: 5209cc6b721bf1d10df0e0506b5b865e26b9632aeec311cacb268773f5bce0aa359029f1aa00ebb39c304b530681b3c1820b3800c2519f9bb8373d2f6a500acc
7
- data.tar.gz: 74b40af8d9fd64312a67b61179b45c12b49bcd4c164a8d93bdcdc7bc8cea522da84b668c37c79aff7b2331e70e1c69e74e904e8d326cff788d893eb249e251cf
6
+ metadata.gz: c5a00b7158acd0c3f3cd3450747e52a4272738f1a0c9283d8f04f85a7f72d7d679dbbbcfa7f4ca1bec55fca464fe78bdcafee16bc2f7f8bebf7c57efc0d5eb89
7
+ data.tar.gz: ae49d66407189500ade52c7d9b8458aef0649c8f4f830ba46e1d57270f4a7a557e0e3c1adae068cb40bfd693b7bc89d8e732af343685f2b99a92867e7ec65dcb
@@ -48,7 +48,7 @@ module Elasticrepo
48
48
  # search for a sub_string
49
49
  #
50
50
  search = Tire::Search::Search.new(@idx)
51
- search.query { string('description:*"#{sub_string}"*') }
51
+ search.query { string('description:"#{sub_string}"') }
52
52
  search.results
53
53
  end
54
54
 
@@ -1,3 +1,3 @@
1
1
  module Elasticrepo
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -1,31 +1,22 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Elasticrepo::Indexer do
4
- let(:repos) { Elasticrepo::Indexer.new("lapaty") }
5
- subject(:indexer) { repos.import }
4
+ let(:elastic_repo) { Elasticrepo::Indexer.new("lapaty") }
5
+ subject(:import) { elastic_repo.import }
6
6
 
7
- context "print Elasticrepo::Indexer instantiation for debugging purposes" do
8
- its("repos") { print "#{repos} \n \n" }
9
- its("repos.class") { print "#{repos.class} \n \n" }
10
- its("repos.inspect") { print "#{repos.inspect} \n \n" }
11
-
12
- its("repos.extracted") { print "#{repos.extracted} \n \n" }
13
- its("repos.extracted.class") { print "#{repos.extracted.class} \n \n" }
14
- its("repos.extracted.inspect") { print "#{repos.extracted.inspect} \n \n" }
7
+ context "print Elasticrepo::import instantiation for debugging purposes" do
8
+ its("elastic_repo") { print "#{elastic_repo} \n \n" }
9
+ its("elastic_repo.class") { print "#{elastic_repo.class} \n \n" }
10
+ its("elastic_repo.inspect") { print "#{elastic_repo.inspect} \n \n" }
15
11
  end
16
12
 
17
13
  context "print before instance import for debugging purposes" do
18
- its("indexer.extracted") { print "indexer: #{indexer.extracted} \n \n" }
19
- its("indexer.extracted.class") { print "indexer.extracted.class: #{imported.class} \n \n" }
20
- its("indexer.extracted.inspect") { print "indexer.extracted.inspect: #{indexer.extracted.inspect} \n \n" }
14
+ its("import") { print "import: #{import} \n \n" }
15
+ its("import.class") { print "import.class: #{import.class} \n \n" }
16
+ its("import.inspect") { print "import.inspect: #{import.inspect} \n \n" }
21
17
  end
22
18
 
23
- #describe "#import" do
24
- #it { subject.to_json.should include(5392501,"cainlevy","photor") }
25
- # its("imported") { print "imported #{imported} \n \n" }
26
- #end
27
-
28
- #[{"id":5392501,"owner":"cainlevy","name":"photor","url":"https://api.github.com/repos/cainlevy/photor","description":"Photo Organizer (in Ruby)","created_at":"2012-08-12T22:26:08Z","pushed_at":"2013-02-19T03:11:10Z","organization":"User","full_name":"cainlevy/photor","language":"Ruby","updated_at":"2013-03-13T02:05:33Z"},{"id":612595,"owner":"aino","name":"galleria","url":"https://api.github.com/repos/aino/galleria","description":"The JavaScript Image Gallery","created_at":"2010-04-15T21:11:51Z","pushed_at":"2013-03-01T20:16:55Z","organization":"Organization","full_name":"aino/galleria","language":"JavaScript","updated_at":"2013-04-18T06:30:41Z"}]
19
+ #[{"id":5392501,"owner":"cainlevy","name":"photor","url":"https://api.github.com/elastic_repo/cainlevy/photor","description":"Photo Organizer (in Ruby)","created_at":"2012-08-12T22:26:08Z","pushed_at":"2013-02-19T03:11:10Z","organization":"User","full_name":"cainlevy/photor","language":"Ruby","updated_at":"2013-03-13T02:05:33Z"},{"id":612595,"owner":"aino","name":"galleria","url":"https://api.github.com/elastic_repo/aino/galleria","description":"The JavaScript Image Gallery","created_at":"2010-04-15T21:11:51Z","pushed_at":"2013-03-01T20:16:55Z","organization":"Organization","full_name":"aino/galleria","language":"JavaScript","updated_at":"2013-04-18T06:30:41Z"}]
29
20
 
30
21
  # describe "GET index" do
31
22
  # it "assigns all reports as @reports" do
@@ -34,42 +25,21 @@ describe Elasticrepo::Indexer do
34
25
  # assigns(:reports).should include(report)
35
26
  # end
36
27
  # end
37
- end
38
28
 
29
+ describe "#import" do
30
+ context "searching" do
31
+ # see also: https://github.com/ferpetrelli/elasticsearch_tire_test
32
+ subject { elastic_repo.delete }
33
+ subject { import }
34
+ let(:search) { Tire::Search::Search.new("repositories") }
39
35
 
40
- # describe "#search" do
41
- # before(:each) do
42
- # @elasticrepo = Elasticrepo::Indexer.tire.index.delete
43
- # @elasticrepo = Elasticrepo::Indexer.create_elasticsearch_index
44
-
45
- # @repo_1 = @elasticrepo.create({
46
- # :name => "test user",
47
- # :age => 25
48
- # })
49
- # @repo_2 = @elasticrepo.create({
50
- # :name => "another name in the spec",
51
- # :age => 23
52
- # })
53
- #
54
- # @elasticrepo.all.each do |s|
55
- # s.tire.update_index
56
- # end
57
- # @elasticrepo.tire.index.refresh
58
- # end
36
+ it "find one repo matching" do
37
+ search.query { string('description:*mage Gall') }
38
+ search.results.count.should == 1
39
+ end
59
40
 
60
- # context "Searching" do
61
- # describe "users" do
62
- # it "should filter users by name" do
63
- # result = @elasticrepo.user_search(:name => "user")
64
- # result.count.should == 1
65
- # result.first.name.should == @user_1.name
66
- # end
41
+ its("print search results: ") { print "#{search.results}" }
42
+ end
43
+ end
67
44
 
68
- # it "should filter users by age" do
69
- # result = @elasticrepo.user_search(:age => 23)
70
- # result.count.should == 1
71
- # result.first.age.should == @user_2.age
72
- # end
73
- # end
74
- # end
75
- # end
45
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticrepo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca G. Soave
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-26 00:00:00.000000000 Z
11
+ date: 2013-04-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |2
14
14
  Feed me.