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 +4 -4
- data/bin/ethical-clothing +0 -16
- data/bin/setup +1 -1
- data/lib/ethical_clothing/brands.rb +1 -1
- data/lib/ethical_clothing/cli.rb +19 -0
- data/lib/ethical_clothing/scraper.rb +4 -13
- data/lib/ethical_clothing/version.rb +1 -1
- data/lib/ethical_clothing.rb +0 -1
- metadata +2 -4
- data/ethical_clothing-0.1.0.gem +0 -0
- data/ethical_clothing-0.2.0.gem +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d46c5ec22496a05cf50ce34a863c3e6a33bc8743
|
|
4
|
+
data.tar.gz: ca1c6faf821c04725fcc90f50272398e4eb86e49
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
data/lib/ethical_clothing/cli.rb
CHANGED
|
@@ -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.
|
|
41
|
-
|
|
42
|
-
|
|
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
|
data/lib/ethical_clothing.rb
CHANGED
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.
|
|
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-
|
|
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
|
data/ethical_clothing-0.1.0.gem
DELETED
|
Binary file
|
data/ethical_clothing-0.2.0.gem
DELETED
|
Binary file
|