brandify 0.0.1

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/brandify.rb +65 -0
  3. metadata +44 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1fd231ddde0d429a2151fd1f47a21cf0d210fa33
4
+ data.tar.gz: ed2ebbe8099f32e37cd5332f18d86a1ccf3fc0b4
5
+ SHA512:
6
+ metadata.gz: 22de7eb5de0bc8f748308d77f4d0d7fb3b6dd47d5a86c587303fc4ab120d96fe32fc5f29cce2ecd47c22fdd5883300dcc3e747750f5e16052a32dc154f96491f
7
+ data.tar.gz: 300c9d58f78313717a4c5b0e04e35a39aed8c354b6c3c0d51ddd1376039e4f66c31ca715827239c076de0d2c710ff3634ad9d24cabc41572f6984024d327ee92
data/lib/brandify.rb ADDED
@@ -0,0 +1,65 @@
1
+ class Brandify
2
+ FOOD = %w( Foodie Burger Whiskey Kale Beer IPA Shrimp Burrito Sushi Watermelon Breastmilk Cabbage )
3
+ SELF = %w( Mother Father Sister Brother Son Daughter Step-cousin Veteran Married Aunt Uncle )
4
+ POLITICS = %w( Democrat Republican Conservative Gun 2A Liberal GOP Feminist Marxist Fascist )
5
+ TECH = [ "Web dev", "Ruby", "Dev ops", "IT", "Apple", "Engineer", "Javascript", "Tech" ]
6
+ BRANDING = [ "Marketing", "Inbound", "Brand", "Synergy", "Leverage", "Catalyst", "Thought leader" ]
7
+ HOBBIES = %w( Anime Steampunk Dog Cat Film TV Music )
8
+ BAD = %w( Hitler Mao Stalin Pinochet Thatcher Piss Xanax Hell Prison )
9
+ THINGS = FOOD + SELF + POLITICS + TECH + BRANDING + HOBBIES + BAD
10
+
11
+ MODIFIERS = %w(
12
+ dude man bro dad girl chick lady mom
13
+ fan addict snob maniac junkie nerd geek dork
14
+ liker lover enjoyer respecter disliker hater
15
+ writer blogger journalist crier wonk enthusiast
16
+ )
17
+
18
+ LOCATIONS = %w( NYC SF LA Boston Philly London Paris Hell )
19
+ EMOJIS = %w( :plane: :toilet: :fire: :100: )
20
+
21
+ def self.bio
22
+ things = THINGS.sample(10)
23
+ modifiers = choose_some_modifiers
24
+ things_to_modify = things.sample(modifiers.size)
25
+ left_alone = things - things_to_modify
26
+ modified_things = modify_some_things(things_to_modify, modifiers)
27
+ full_array = (left_alone + modified_things).shuffle
28
+ # At most we'll add 10 hashtags so we need a bio of 150 or less to stay under 160
29
+ full_array = ensure_valid_length(full_array, 150)
30
+ join_results(add_hashtags(full_array))
31
+ end
32
+
33
+ def self.location
34
+ locations = LOCATIONS.sample(3)
35
+ emojis = EMOJIS.sample(2)
36
+ full_array = locations.first(2).zip(emojis) << locations.last
37
+ full_array.flatten!
38
+ full_array = ensure_valid_length(full_array, 30)
39
+ full_array.join(" ")
40
+ end
41
+
42
+ private
43
+
44
+ def self.choose_some_modifiers
45
+ 10.times.map { MODIFIERS.sample if 1 + rand(10) > 7 }.compact
46
+ end
47
+
48
+ def self.modify_some_things(things, modifiers)
49
+ things.zip(modifiers).map { |pair| pair.join(" ") }
50
+ end
51
+
52
+ def self.add_hashtags(array)
53
+ array.map! { |i| 1 + rand(10) > 8 ? "##{i}" : i }
54
+ end
55
+
56
+ def self.ensure_valid_length(array, length_cap)
57
+ array.pop while join_results(array).length > length_cap
58
+ array
59
+ end
60
+
61
+ def self.join_results(array)
62
+ array.join(". ") + "."
63
+ end
64
+
65
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: brandify
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Ian Donovan
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-04-12 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: 'Generates a #powerful, #shareable twitter bio.'
14
+ email: idonovan90@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/brandify.rb
20
+ homepage: http://rubygems.org/gems/brandify
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.4.3
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: "#Brand your life"
44
+ test_files: []