summaryrefslogtreecommitdiff
path: root/lib/random.rb
diff options
context:
space:
mode:
authorDavid T. Sadler <davidtsadler@googlemail.com>2019-03-25 21:05:35 +0000
committerDavid T. Sadler <davidtsadler@googlemail.com>2019-03-25 21:05:35 +0000
commite1f06b311652786b2a3c9dd5981bbe9b51383d1a (patch)
tree6a584596d2d402f6eeb1e4bc14374a76fb8e1dec /lib/random.rb
parent4972068ab2e97a017e28f4e7b91858f9fcaeceb6 (diff)
Begining of rebuild.
Diffstat (limited to 'lib/random.rb')
-rw-r--r--lib/random.rb31
1 files changed, 0 insertions, 31 deletions
diff --git a/lib/random.rb b/lib/random.rb
deleted file mode 100644
index ecefd93..0000000
--- a/lib/random.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-module TestPosts
- module Random
- APPLICATIONS = ['Apache 2', 'MySQL', 'Sqlite', 'Magento']
-
- DISTROS = ['Ubuntu', 'Fedora', 'Kubuntu', 'Mythbuntu', 'SUSE Linux', 'Debian']
-
- FRAMEWORKS = ['Ruby on Rails', 'CakePHP', 'Wordpress', 'Sinatra', 'Drupal']
-
- LANGUAGES = ['Actionscript', 'Ada', 'Assembly', 'C', 'C#', 'C++', 'Cobol', 'ColdFusion', 'D', 'Delphi', 'Erlang', 'Forth', 'Fortran', 'Haskell', 'Java', 'JavaScript', 'Lisp', 'Lua', 'OCaml', 'Objective C', 'PHP', 'Pascal', 'Perl', 'Python', 'Rexx', 'Ruby', 'SQL', 'Scala', 'Scheme', 'Shell', 'Smalltalk', 'Tcl', 'Visual Basic']
-
- TITLES = [
- [['Getting started with', 'A tutorial on', 'Why I like', "Why I don't like", 'Developing applications with'], LANGUAGES + FRAMEWORKS],
- [['Getting started with', 'How to install', 'How to upgrade'], DISTROS + APPLICATIONS + FRAMEWORKS],
- [['Developing a plugin for'], FRAMEWORKS]
- ]
-
- def self.generate
- topics, subjects = TITLES[rand(TITLES.size)]
- topic = topics[rand(topics.size)]
- subject = subjects[rand(subjects.size)]
- [date, topic + ' ' + subject, subject]
- end
-
- private
- def self.date
- jdFrom = Date.today.prev_year.jd
- jdTo = Date.today.jd
- Date.jd(rand((jdTo + 1) - jdFrom) + jdFrom).strftime('%Y-%m-%d')
- end
- end
-end