groonga-client-rails 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/doc/text/news.md +6 -0
  3. data/lib/groonga/client/rails/version.rb +1 -1
  4. data/lib/groonga/client/searcher/select/request.rb +21 -4
  5. data/test/apps/rails4-mongoid/Gemfile.lock +4 -4
  6. data/test/apps/rails4-mongoid/log/development.log +764 -0
  7. data/test/apps/rails4-mongoid/log/test.log +16564 -0
  8. data/test/apps/rails4-mongoid/test/searchers/posts_searcher_test.rb +5 -5
  9. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/-Xhj-Mbb82rk571sDsQxrdCywGX36vsenBH1RUlK-LY.cache +1 -0
  10. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/0f_MbWM7kHYaEii2fU46RtcPM1c5AvKKzZXw_HiM0CE.cache +1 -0
  11. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/2PZE0O2lwq-MOTwxKTZxLxQwY8_QyhrbRsthl3Lc4lQ.cache +0 -0
  12. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache +0 -0
  13. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/5dV_yE4FDckg8xSumojLvTuflbNyhpApq7LPOy-e1X0.cache +0 -0
  14. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/7efkcYvlMpIQU8kuDy1jAKDLjakVGoH6N5V-AuzuTZc.cache +0 -0
  15. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/8Zm1d9-lBPsGG_HUw8FP2OCCVucGDVhWAOGaopvOdss.cache +0 -0
  16. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/9B_fDWO-7yTtWLP7C6kgtW5LN2zlpAqr1km-1jSQx2w.cache +1 -0
  17. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/9X7nmZiJ1BxgVp80vJFjKw2uuEfdS1ik3B66O4_iWPo.cache +0 -0
  18. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/APY89OAPJx9A3D3xcCoktvEvQUs7NcWChYXnjjjPzz0.cache +0 -0
  19. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/CWMzfW8FmEfR6gB4BwariPLjTZTtLc4bCVc0r0m2VV4.cache +0 -0
  20. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/C_ZXB0e-P6-9Ty60eBWeAui5uzzA0NzDW8amqmtTk9g.cache +0 -0
  21. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/Cg1VzEm4v80ed-e0X3WGAHJWYiC_ybnfBrRrIvltPXc.cache +1 -0
  22. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/Cjhm36F4tzUHdc1e0Bho51N0H4HYybVTrxTmbtiqih4.cache +1 -0
  23. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/DSOLSc6A5RVSmvM415eEWAWG_AgOvZcLZOXQjsXyWQA.cache +2 -0
  24. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/EBtbhweQl74JQNkwFL3ahZH_9x44ceqa9hOT8lQ_SfM.cache +2 -0
  25. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/EQICjEOYeXNTngMqEgET0L1SuE4AVuoKyJgio4ks43A.cache +1 -0
  26. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/Edyy4hZsoEraZijGtQOEBXtG2121KJUoZeUxxPjVoD8.cache +1 -0
  27. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/HfA_T6XraGo2Ny22jLyDJkU33FwcVIBOxUIXJAfTZnw.cache +1 -0
  28. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/I-oUhfEICgXeCJ30YmQbpoYtgGAJK0-Pql8kOvfHUIs.cache +1 -0
  29. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/IQDmZuBCEQY2ggnTxRJ1TSu4hZMBcOPUIIZGKsfW7s0.cache +1 -0
  30. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/ITBgBGR9-8E08Y63Vjo65c8DzPESTHJuYCXZp0y6k_I.cache +0 -0
  31. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/JImLmTmbMkDKlN30hse8U-u0IV8hvfdebOL3EFz71FE.cache +0 -0
  32. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/Joxxq6tZo5Z61fNSWcPCGgCyehta1sNKXM0i53ziK0o.cache +2 -0
  33. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/KPHQh44WoGRX0SuVORNxUqq129kPRQ4Sfwr0MgBGTWg.cache +1 -0
  34. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/MQWJrWW-vCooFa9lpB2Z7KDIE9ilL54d5Sf_SRtQhTM.cache +1 -0
  35. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache +0 -0
  36. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/Olyga_OJ5Sz5He_RVZLO_BraSHgGvt9BG0ORecSD4A4.cache +1 -0
  37. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/OoG10cMLeO2eGZxk483Gx75vNDQz7Id8sxVt3g26jQE.cache +0 -0
  38. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/P2sNuT6usNXi8DQFFQ2SMByy1v98zmNdwdx6wduUQDg.cache +1 -0
  39. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/Pm3ENYpCrQMOJGd-d8lACN_nbGZWiivq_KyPLJoD9Xk.cache +0 -0
  40. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/PrxeUFTxE6CmNlJ4CQLxcmAQKwOGBKNCFYluKNhVPdI.cache +0 -0
  41. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/PuNKoh-EB-UU-NnPetIEhS3emExlV586tfFJnBFhaxo.cache +0 -0
  42. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/QyBzeHR44VD1fMDrJcMOaVyyn1xgHnmhPX2VL3R6EdE.cache +0 -0
  43. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/QyU_Bdj5YdiIQef2XhSDP5MQf7l3u_A81md3KFPQ2N4.cache +2 -0
  44. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/R9YbLXVmFuZvXntmUsVoP9gdFgZaoKuww_0l-ulu_Sw.cache +0 -0
  45. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/RbDvgwCB1ggHONj2Gglg9cljN_KExx-gHiSiItOFBVw.cache +1 -0
  46. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/Rkd99KDYtUtVb3U566M9L4YD2Kh-Qp147dHVmyXnDhg.cache +0 -0
  47. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/Sin6bEoASrNa45108CpfgF2jcifz-KpbsvvZJtqVZ68.cache +0 -0
  48. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/SuhtC6f7E2-1SXl4bkRvOKqhzFKTjPvbglVtjbjV6WQ.cache +0 -0
  49. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/WDXpPe61HDYBIqMMzcYJWujunl4HLJBvhn0OOP1yQso.cache +1 -0
  50. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/Y2HHx2PygDVpbc258EY6XyZq_3ocHy5fEq-5UHSNfh0.cache +0 -0
  51. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/Zot5Dwe9yQ1wvCpegdXXjC8DUGHfH1xLxerosBjUsns.cache +0 -0
  52. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/ZwSejSAeaXOqaevCGNDw6GT4jzf6iGxiDfUGqtjYqxE.cache +0 -0
  53. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/bsYyBqujQ9Bb_NkqKjx8J9lC8MPb-Ed59b__aV46Bic.cache +1 -0
  54. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/cnfLEWE92uT-WDII157E3Z5XISKK99q6__D2IiTRhOM.cache +0 -0
  55. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/cnk28xBZ2NhIHyeh4bImJu1D8MsQZksGaVeYZSDL-Mw.cache +0 -0
  56. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/cyuaVF0ZckKku_VGsQYOntnl3oNlSP381WW5VhCMbE4.cache +1 -0
  57. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/ee9ZqYM3D8GORlAyhQhVVtyNcEArBAXuuAcPhnfTNT8.cache +5 -0
  58. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/fQe7NSWabAv2wB6jtw0Tjp5CT06xwpla822ipJiUCy0.cache +1 -0
  59. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/fme939QD_yb-kVcNE40VAdyOZYRTHgZCxYLVDZLuzF0.cache +1 -0
  60. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/gl7MP7d46hviHXVnGFYORtcWessT58E75rSQUFjfiII.cache +0 -0
  61. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/hHOboG408ksat1oQaCWVNxzf-FIyTREQFXHdFZurlZQ.cache +1 -0
  62. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/i5GV8tvuWRKqi-plBB0bdaAqfdW_CpIMlk_3qZYyask.cache +1 -0
  63. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/ioEvK0rblqqEotrMItm0VrKhWOXnC3vwC-CIU9UCZEg.cache +1 -0
  64. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/ivzms341pOxkVrOTXM3Yog9cLwq3SmsXcwGMbRGmM6s.cache +1 -0
  65. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/j0l28m8jfc6vnBWrkD0zWt2ELCJfEOMeEjW0Q4GADNY.cache +0 -0
  66. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/jPuyl--LQd6DGNNoxSkPhBGx_ul_1kfka93EDJmnc8c.cache +1 -0
  67. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/jaYo3RHF_E7SipTqBJcsnR0JcOOa0rFpEHmp3nLDrQI.cache +1 -0
  68. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/k-AcmMnVndxCZnDS4YgQBY0eJq_MkBPoCo247Frtt1Y.cache +1 -0
  69. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/kSkCWaAJCcTgZ_AhrRCjZhNtkE12cubiq70uNtditqk.cache +0 -0
  70. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/mXFXPQpdpe6VdLyG_ATkrFvhK-DzKohwq6B2GOQo9R8.cache +0 -0
  71. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/q2eC-e4sz4yzY37JZQfdjar0jjp4v7rHuGin5JEKV7Q.cache +1 -0
  72. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/s6DK-YkFoxYJMKXt21m9PdMtZi3TJhRoHIi0R5i69Zs.cache +1 -0
  73. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/sLDAakEn7_JrPiyZe0ZUsCLDnaTAal-5HajraaAgdhE.cache +2 -0
  74. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/teXpzhiur3Mnn2KsTY8q4HhEqpbdmKBfBW2iS5-MvUI.cache +1 -0
  75. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/tgZjQMFX0Ebx2i8ovlwnvwULhvrhFNJLAIQjUNZN1RM.cache +0 -0
  76. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/tihMlIo90U72qN2BzGajipIJOWppg8OIJuVnnluwVJM.cache +1 -0
  77. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/vpD8YcdUFmWVggV1ANqLIWcTbMItiGv1aOUd3i_Sf_w.cache +1 -0
  78. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/wBoZhq66JcV9m6-FvOoZ-Q3Cy9mgT-ynjPWZWZdafLw.cache +0 -0
  79. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/wTWJ6pQBopl4RdCt1QzngFCI6BQsl97QiZJO8bkGZd4.cache +1 -0
  80. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/wjVbFqqSw39d-ryprJ1NYmKProunHG47jEI6RFHcLM4.cache +0 -0
  81. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/wm5Vu6DEN0ZExnKV0oAADsKfEn3yvO4aBQJwp6b8FbU.cache +1 -0
  82. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/x0qPZqkeQj_x2GoHegxhwuHhPMrz8iHGdALgbSEtYB0.cache +1 -0
  83. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/xESXQaQoarUInNLmS7yPvF7D9FlSfaR8n8CsT6vIfmU.cache +1 -0
  84. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/xJpeFclkEQS028sCHKPl9C6EyiAcTgUW_lBAqjRuP_c.cache +0 -0
  85. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/yinyMcV6eKC4p76ZeetFBkRq8qYD5b8fWOHbukaCUNk.cache +1 -0
  86. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/ytg8J2fjBhc978nkpdl0f5cBPdcKpig523h4O4eN664.cache +1 -0
  87. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/z5Cl2oKorg00CGt089PLdPdoE1ELvsz4CdtXnlUk7KM.cache +0 -0
  88. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/z6uhOy1uoRnC6c9iKrzc1vRqGH1KQrhArDe51rZL1_k.cache +1 -0
  89. data/test/apps/rails4-mongoid/tmp/cache/assets/sprockets/v3.0/zIFdfoc8nFjrQhTXHyamSnNA6CVVrOcsP4qfDQhOcVI.cache +1 -0
  90. metadata +220 -54
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e0eba8046f328d94ef1f96a7d754ca8b735abb8c
4
- data.tar.gz: 861d91c93f83ff419a71c7f6ea0e994dce45d206
3
+ metadata.gz: ae1aeecc659c4cf220e1053948f4a01135195918
4
+ data.tar.gz: f38dc25d82bca1d26369dd69e9b2610c9f6ac3e3
5
5
  SHA512:
6
- metadata.gz: 2c90d0147eb0aa2f1467d8bbbfb341fef0c56a95f1c3e858a9dad73cbd134dd6f2351bf0a878ab353fcd559fe0a33bdf24864e17954659b36e4b17152b481189
7
- data.tar.gz: 64523981496bc3ded1caa5e2c4143a9c641ae80e960e5a45129cd214ac7e8918094825a546e1d6bae3d48dbef30a8a137cdea077a7dd9220dd8d664dbf820798
6
+ metadata.gz: 85b3c15830736f9430ab18f9dd4d776ff69619c82e9000ba8e6297504e32c0e427cea6b3a92ce21c8108d200815c298f3ad38bb4e69f29207a59232288434916
7
+ data.tar.gz: 6840a0971efe941f3da05a46f724d86f28f39bec24d1968b87a167d8d6b69cb03e401083230e9bcc3c96d14356be186062e7a1157040af5348f293c92189a37b
data/doc/text/news.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # NEWS
2
2
 
3
+ ## 0.9.3 - 2016-06-07
4
+
5
+ ### Improvements
6
+
7
+ * Added native Kaminari support.
8
+
3
9
  ## 0.9.2 - 2016-03-28
4
10
 
5
11
  ### Fixes
@@ -17,7 +17,7 @@
17
17
  module Groonga
18
18
  class Client
19
19
  module Rails
20
- VERSION = "0.9.2"
20
+ VERSION = "0.9.3"
21
21
  end
22
22
  end
23
23
  end
@@ -34,7 +34,7 @@ module Groonga
34
34
  end
35
35
 
36
36
  def result_set
37
- @result_set ||= ResultSet.new(response)
37
+ @result_set ||= create_result_set
38
38
  end
39
39
 
40
40
  def match_columns(value)
@@ -74,15 +74,32 @@ module Groonga
74
74
  def paginate(page, per_page: 10)
75
75
  page ||= 1
76
76
  page = page.to_i
77
- return self if page < 0
78
-
79
- offset(per_page * page).limit(per_page)
77
+ if page <= 0
78
+ offset = 0
79
+ else
80
+ offset = per_page * (page - 1)
81
+ end
82
+ offset(offset).limit(per_page)
80
83
  end
81
84
 
82
85
  private
83
86
  def create_request(parameters)
84
87
  self.class.new(parameters)
85
88
  end
89
+
90
+ def create_result_set
91
+ result_set = ResultSet.new(response)
92
+ if paginated? and defined?(Kaminari)
93
+ result_set.extend(Kaminari::ConfigurationMethods::ClassMethods)
94
+ result_set.extend(Kaminari::PageScopeMethods)
95
+ end
96
+ result_set
97
+ end
98
+
99
+ def paginated?
100
+ parameters = to_parameters
101
+ parameters.key?(:offset) and parameters.key?(:limit)
102
+ end
86
103
  end
87
104
 
88
105
  # @private
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../../../
3
3
  specs:
4
- groonga-client-rails (0.9.0)
4
+ groonga-client-rails (0.9.3)
5
5
  groonga-client (>= 0.2.4)
6
6
  rails
7
7
 
@@ -68,13 +68,13 @@ GEM
68
68
  globalid (0.3.6)
69
69
  activesupport (>= 4.1.0)
70
70
  gqtp (1.0.6)
71
- groonga-client (0.2.4)
71
+ groonga-client (0.2.5)
72
72
  gqtp (>= 1.0.4)
73
73
  groonga-command (>= 1.2.0)
74
74
  hashie
75
75
  groonga-command (1.2.0)
76
76
  json
77
- hashie (3.4.3)
77
+ hashie (3.4.4)
78
78
  i18n (0.7.0)
79
79
  jbuilder (2.4.1)
80
80
  activesupport (>= 3.0.0, < 5.1)
@@ -187,4 +187,4 @@ DEPENDENCIES
187
187
  web-console (~> 2.0)
188
188
 
189
189
  BUNDLED WITH
190
- 1.11.2
190
+ 1.12.5