finviz_rails 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bed5770dd714aadb64a2a691e94a340594c57dd8
4
- data.tar.gz: e1a36d8edf2324d300014151679756d0880f0fb6
3
+ metadata.gz: 07733b1234ed0a79d791281010bf08d12e7e4eca
4
+ data.tar.gz: 92dab6859ad5ebbb019c88eb90365e5fbf799650
5
5
  SHA512:
6
- metadata.gz: 497dcc3dac3e50fb3f3d0082f7d95f6bb06a8a61759fae16001836102533fc779d0dbff4671a9de3d3fa00f00b2e387c5fc80ab691cfdb9b9b52d2019adc6335
7
- data.tar.gz: d668f156720f0b87f53dca9c6d9368efe09b39da6a4067c41d62ab25018a786cda162de4a1dd18ac2e09dbdef5e75dc87903ca506d133e7c8c20010da4cee270
6
+ metadata.gz: e2a3d0898554e8966331c917e1e0efe9240881af34fece36aabcfec8497b2eb65ab659c844df4f4eef793c298dce309cd0ab4a21650f4e1f5bbb248fc32f4576
7
+ data.tar.gz: 0a3bc1346d1002ee58d27c5022096e91d104d1c526181bf5ddc85afe07fb5ed94071127c45f9d93b81b2d153b266ed8df296a95a36effb8a65c4f9c92a1c1abd
@@ -20,6 +20,10 @@ class Finviz
20
20
  Indices.new(agent, @authenticated).run
21
21
  end
22
22
 
23
+ def url(params)
24
+ UrlFormatter.new(nil, nil, params).run
25
+ end
26
+
23
27
  private
24
28
 
25
29
 
@@ -26,11 +26,15 @@ class Screener
26
26
  def results
27
27
  {
28
28
  found_stock_count: @found_stock_count,
29
- returned_stock_count: @stocks.count,
30
- stocks: @stocks
29
+ returned_stock_count: returned_stocks.count,
30
+ stocks: returned_stocks
31
31
  }
32
32
  end
33
33
 
34
+ def returned_stocks
35
+ max_stock_count ? @stocks.first(max_stock_count) : @stocks
36
+ end
37
+
34
38
  def set_found_stock_count
35
39
  @found_stock_count = begin
36
40
  text = @agent.page.parser.css('.count-text').text
@@ -1,3 +1,3 @@
1
1
  module FinvizRails
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -429,5 +429,75 @@ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
429
429
   (0.1ms) begin transaction
430
430
  --------------------------------------------------------------
431
431
  FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
432
+ --------------------------------------------------------------
433
+  (0.1ms) rollback transaction
434
+  (0.1ms) begin transaction
435
+ --------------------------------------------------------------
436
+ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
437
+ --------------------------------------------------------------
438
+  (0.1ms) rollback transaction
439
+  (0.1ms) begin transaction
440
+ --------------------------------------------------------------
441
+ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
442
+ --------------------------------------------------------------
443
+  (0.1ms) rollback transaction
444
+  (0.1ms) begin transaction
445
+ --------------------------------------------------------------
446
+ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
447
+ --------------------------------------------------------------
448
+  (0.1ms) rollback transaction
449
+  (0.1ms) begin transaction
450
+ --------------------------------------------------------------
451
+ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
452
+ --------------------------------------------------------------
453
+  (0.1ms) rollback transaction
454
+  (0.1ms) begin transaction
455
+ --------------------------------------------------------------
456
+ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
457
+ --------------------------------------------------------------
458
+  (0.1ms) rollback transaction
459
+  (0.1ms) begin transaction
460
+ --------------------------------------------------------------
461
+ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
462
+ --------------------------------------------------------------
463
+  (0.1ms) rollback transaction
464
+  (0.1ms) begin transaction
465
+ --------------------------------------------------------------
466
+ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
467
+ --------------------------------------------------------------
468
+  (0.1ms) rollback transaction
469
+  (0.1ms) begin transaction
470
+ --------------------------------------------------------------
471
+ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
472
+ --------------------------------------------------------------
473
+  (0.1ms) rollback transaction
474
+  (0.1ms) begin transaction
475
+ --------------------------------------------------------------
476
+ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
477
+ --------------------------------------------------------------
478
+  (0.1ms) rollback transaction
479
+  (0.1ms) begin transaction
480
+ --------------------------------------------------------------
481
+ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
482
+ --------------------------------------------------------------
483
+  (0.1ms) rollback transaction
484
+  (0.1ms) begin transaction
485
+ --------------------------------------------------------------
486
+ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
487
+ --------------------------------------------------------------
488
+  (0.1ms) rollback transaction
489
+  (0.1ms) begin transaction
490
+ --------------------------------------------------------------
491
+ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
492
+ --------------------------------------------------------------
493
+  (0.1ms) rollback transaction
494
+  (0.1ms) begin transaction
495
+ --------------------------------------------------------------
496
+ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
497
+ --------------------------------------------------------------
498
+  (0.1ms) rollback transaction
499
+  (0.1ms) begin transaction
500
+ --------------------------------------------------------------
501
+ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
432
502
  --------------------------------------------------------------
433
503
   (0.1ms) rollback transaction
@@ -5,12 +5,9 @@ class FinvizRailsTest < ActiveSupport::TestCase
5
5
  test "non-auth screener get first page of data" do
6
6
  finviz = Finviz.new
7
7
  pp finviz.screener(
8
- price_range: "2to3",
9
- analyst_recommendation: "strongbuy",
10
- average_volume: "o50",
11
- pattern: "wedgedown",
8
+ # analyst_recommendation: "strongbuy",
12
9
  is_active: true,
13
- somethig_wrong: "slj"
10
+ max_stock_count: 1
14
11
  )
15
12
  end
16
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: finviz_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nemrow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-09 00:00:00.000000000 Z
11
+ date: 2016-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails