ethical_clothing 0.2.3 → 0.2.4

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: 393be8820f499cd94aad92e35203ecc78be0d75c
4
- data.tar.gz: 9df5f90e7a2b67d79e1d54893c66c1c8055f1fd0
3
+ metadata.gz: d46c5ec22496a05cf50ce34a863c3e6a33bc8743
4
+ data.tar.gz: ca1c6faf821c04725fcc90f50272398e4eb86e49
5
5
  SHA512:
6
- metadata.gz: 151bfe31cc55e9345da76ffd8eb55ca93e24c5a7e52376212543084bdfd63d4fc9b9436fafaf48df3f21460177629f6e003e9b4fff50506daa18aab3f7af4e9e
7
- data.tar.gz: 94666e92fa06f49eb4b07ca6e30ff687a20640fa8bc13ecf7b8d3dcffa7c2f40fdc3ae6ca7e9ca05c064282f7d41fdfc3f1a0e81e122b0cfab14179cc981a440
6
+ metadata.gz: c6be687ea5bc94457c4c1cdd8d0d80c06ed1626a6a524c671be3784b3ae378c271cc3bb790ed4fbca0db8e32903c924c3b7dad7ceb39cab25c5c9a85e33ff732
7
+ data.tar.gz: fb29dbb2c722907c75db45a0039a74401386f218041dfc180ad5206dfd7864ee2054ba98b9ebe19327b0a8f25be921aa9a08a0094bbb263888787070bfbed1f9
data/bin/ethical-clothing CHANGED
@@ -1,20 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
2
  require '../lib/ethical_clothing'
3
3
 
4
- #
5
- puts "---------Welcome to the Ethical Clothing ClI App-----------"
6
- puts "A few things to note: "
7
- puts ""
8
- puts "Ethical fashion (or slow fashion or sustainable fashion) simply means that the retailer is transparent about where they're sourcing their clothes, that they pay fairly, and use materials that are organic, un-harmful, or recycled when possible. "
9
- puts ""
10
- puts "....one moment, we are collecting your brands..."
11
- puts ""
12
- EthicalClothing::Scraper.get_and_create_brands
13
- puts ""
14
- puts ".........."
15
- puts ""
16
- puts "....."
17
- puts ""
18
- EthicalClothing::Scraper.match
19
-
20
4
  EthicalClothing::CLI.new.call
data/bin/setup CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env bash
1
+ #!/bin/bash
2
2
  set -euo pipefail
3
3
  IFS=$'\n\t'
4
4
  set -vx
@@ -14,7 +14,7 @@ class EthicalClothing::Brand
14
14
  self.save
15
15
  end
16
16
 
17
-
17
+
18
18
 
19
19
  def self.all
20
20
  @@all
@@ -1,9 +1,28 @@
1
1
  class EthicalClothing::CLI
2
2
  def call
3
+ welcome_and_scrape
3
4
  list_brands
4
5
  menu
5
6
  end
6
7
 
8
+ def welcome_and_scrape
9
+ #
10
+ puts "---------Welcome to the Ethical Clothing ClI App-----------"
11
+ puts "A few things to note: "
12
+ puts ""
13
+ puts "Ethical fashion (or slow fashion or sustainable fashion) simply means that the retailer is transparent about where they're sourcing their clothes, that they pay fairly, and use materials that are organic, un-harmful, or recycled when possible. "
14
+ puts ""
15
+ puts "....one moment, we are collecting your brands..."
16
+ puts ""
17
+ EthicalClothing::Scraper.get_and_create_brands
18
+ puts ""
19
+ puts ".........."
20
+ puts ""
21
+ puts "....."
22
+ puts ""
23
+ EthicalClothing::Scraper.match
24
+ end
25
+
7
26
 
8
27
 
9
28
 
@@ -34,22 +34,13 @@ class EthicalClothing::Scraper
34
34
  def self.get_description
35
35
  session = Capybara::Session.new(:poltergeist)
36
36
  session.visit("http://simplylivandco.com/blog/best-places-to-buy-affordable-ethical-fashion")
37
- desc_holder = []
37
+ # desc_holder = []
38
38
  desc_elements = session.all("p")
39
39
 
40
- desc_elements.each do |element|
41
- if element.text == ""
42
- element = "Not Available"
43
- else
44
- desc_holder << element.text
45
- end
46
- end
40
+ desc_elements.collect do |element|
41
+ element.text
42
+ end[3..-1]
47
43
 
48
- #get rid of extra elements that are not descriptions
49
- 3.times do
50
- desc_holder.shift
51
- end
52
- desc_holder
53
44
 
54
45
 
55
46
  end
@@ -1,3 +1,3 @@
1
1
  module EthicalClothing
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
@@ -2,5 +2,4 @@ require_relative './ethical_clothing/version.rb'
2
2
  require_relative './ethical_clothing/cli.rb'
3
3
  require_relative './ethical_clothing/brands.rb'
4
4
  require_relative './ethical_clothing/scraper.rb'
5
-
6
5
  #acts as environment,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ethical_clothing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katleiah
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-08 00:00:00.000000000 Z
11
+ date: 2018-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -56,8 +56,6 @@ files:
56
56
  - bin/console
57
57
  - bin/ethical-clothing
58
58
  - bin/setup
59
- - ethical_clothing-0.1.0.gem
60
- - ethical_clothing-0.2.0.gem
61
59
  - ethical_clothing.gemspec
62
60
  - lib/ethical_clothing.rb
63
61
  - lib/ethical_clothing/brands.rb
Binary file
Binary file