zimki 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +82 -0
- data/Rakefile +13 -0
- data/lib/zimki.rb +208 -0
- data/spec/source/a.txt +1 -0
- data/spec/source/b.txt +1 -0
- data/spec/source/dst.txt +125 -0
- data/spec/source/expectation.textile +125 -0
- data/spec/source/src.txt +137 -0
- data/spec/zimki_spec.rb +130 -0
- data/zimki.gemspec +21 -0
- metadata +68 -0
data/README.md
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
Zimki is a text conversion tool which translates files written in [zimki Desktop Wiki][zimki] to
|
2
|
+
[textile][textile].
|
3
|
+
|
4
|
+
|
5
|
+
## Installation ##
|
6
|
+
|
7
|
+
Type in your console
|
8
|
+
|
9
|
+
gem install zimki
|
10
|
+
|
11
|
+
and you can use the gem.
|
12
|
+
|
13
|
+
|
14
|
+
## Usage ##
|
15
|
+
|
16
|
+
Here is an example how you can use it.
|
17
|
+
|
18
|
+
require 'zimki'
|
19
|
+
|
20
|
+
zimki = Zimki.new
|
21
|
+
zimki.textile_conversion("src.txt")
|
22
|
+
|
23
|
+
A typical text file in the zimki format can be found in this repository under `spec/source/src.txt`.
|
24
|
+
The output will be written in the console - so then copy the things you need.
|
25
|
+
|
26
|
+
|
27
|
+
## Current translation status ##
|
28
|
+
|
29
|
+
Currently the gem can translate the following constructs. On the left you can see the zimki format
|
30
|
+
and on the right of the arrow you can see the textile pendant.
|
31
|
+
|
32
|
+
|
33
|
+
### General constructs ###
|
34
|
+
|
35
|
+
//italique// => _italique_
|
36
|
+
**bold** => *bold*
|
37
|
+
__highlight => @highlight@
|
38
|
+
|
39
|
+
|
40
|
+
### Headings ###
|
41
|
+
|
42
|
+
==== The 10-day MBA ==== => h1. The 10-day MBA
|
43
|
+
=== The 10-day MBA === => h2. The 10-day MBA
|
44
|
+
== The 10-day MBA == => h3. The 10-day MBA
|
45
|
+
|
46
|
+
|
47
|
+
### Links and Images ###
|
48
|
+
|
49
|
+
|
50
|
+
[[http://wikimatze.de|wikimatze]] => "wikimatze":http://wikimatze.de
|
51
|
+
{{~/Dropbox/pics/Screenshot.png}} => !http://~/Dropbox/pics/Screenshot.png!
|
52
|
+
|
53
|
+
|
54
|
+
### Bullets ###
|
55
|
+
|
56
|
+
* first bullet
|
57
|
+
* second bulltet
|
58
|
+
* third bullet
|
59
|
+
* fourth
|
60
|
+
|
61
|
+
=>
|
62
|
+
|
63
|
+
* first bullet
|
64
|
+
** second bulltet
|
65
|
+
*** third bullet
|
66
|
+
**** fourth
|
67
|
+
|
68
|
+
|
69
|
+
## Contact ##
|
70
|
+
|
71
|
+
Feature request, bugs, questions, etc. can be send to <matthias.guenther@wikimatze.de>.
|
72
|
+
|
73
|
+
|
74
|
+
## License ##
|
75
|
+
|
76
|
+
This software is licensed under the [MIT license][mit].
|
77
|
+
|
78
|
+
© 2011 Matthias Guenther <matthias.guenther@wikimatze.de>.
|
79
|
+
|
80
|
+
[mit]: http://en.wikipedia.org/wiki/MIT_License
|
81
|
+
[textile]: http://en.wikipedia.org/wiki/Textile_(markup_language)/
|
82
|
+
[zimki]: http://zim-wiki.org/
|
data/Rakefile
ADDED
data/lib/zimki.rb
ADDED
@@ -0,0 +1,208 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
class Zimki
|
4
|
+
|
5
|
+
def remove_content_type_textile(text)
|
6
|
+
show_regexp(text, /Content-Type:([A-Za-z0-9\/:<>!?_\s-]*)/, "content_type")
|
7
|
+
end
|
8
|
+
|
9
|
+
def remove_wiki_format(text)
|
10
|
+
show_regexp(text, /Wiki-Format:[A-Za-z0-9.\s]*/, "wiki_format")
|
11
|
+
end
|
12
|
+
|
13
|
+
def remove_creation_date(text)
|
14
|
+
show_regexp(text, /Creation-Date:([A-Za-z0-9.:!?_\s-]*)/, "creation_date")
|
15
|
+
end
|
16
|
+
|
17
|
+
def remove_big_header(text)
|
18
|
+
show_regexp(text, /======([A-Za-z0-9.:!?_\s-]*)======/, "big_header")
|
19
|
+
end
|
20
|
+
|
21
|
+
def remove_created(text)
|
22
|
+
show_regexp(text, /Created([A-Za-z0-9.:!?_\s-]*)\n/, "created")
|
23
|
+
end
|
24
|
+
|
25
|
+
def convert_italique_to_textile(text)
|
26
|
+
text = text.gsub("//", "_")
|
27
|
+
text.gsub("http:_", "http://")
|
28
|
+
end
|
29
|
+
|
30
|
+
def convert_bold_to_textile(text)
|
31
|
+
text.gsub("**", "*")
|
32
|
+
end
|
33
|
+
|
34
|
+
def convert_highlight_to_textile(text)
|
35
|
+
text.gsub("__", "@")
|
36
|
+
end
|
37
|
+
|
38
|
+
def replace_leading_newlines(text)
|
39
|
+
text.gsub("\n\n\n", "")
|
40
|
+
end
|
41
|
+
|
42
|
+
def convert_first_bullet(text)
|
43
|
+
show_regexp(text, /\t\* ([\\A-Za-z0-9"'?<>=:!?_\/\n]*)/, "first_bullet")
|
44
|
+
end
|
45
|
+
|
46
|
+
def convert_second_bullet(text)
|
47
|
+
show_regexp(text, /\t\t\* ([\\A-Za-z0-9"'?<>=:!?_\/\n]*)/, "second_bullet")
|
48
|
+
end
|
49
|
+
|
50
|
+
def convert_third_bullet(text)
|
51
|
+
show_regexp(text, /\t\t\t\* ([\\A-Za-z0-9"'?<>=:!?_\/\n]*)/, "third_bullet")
|
52
|
+
end
|
53
|
+
|
54
|
+
def convert_link_to_textile(text)
|
55
|
+
show_regexp(text, /\[\[http[A-Za-z0-9.-:]*\|[A-Za-z.]*\]\]|http[A-Za-z0-9.-:]*/, "link")
|
56
|
+
end
|
57
|
+
|
58
|
+
def convert_verbatim_to_textile(text)
|
59
|
+
show_regexp(text, /'''\n([A-Za-z0-9"'?<>!?_\t\n]*)(\n''')/, "verbatim")
|
60
|
+
end
|
61
|
+
|
62
|
+
def h_one_title(text)
|
63
|
+
show_regexp(text, /====([A-Za-z0-9.:!?_\s-]*)====/, "h_one_header")
|
64
|
+
end
|
65
|
+
|
66
|
+
def h_two_title(text)
|
67
|
+
show_regexp(text, /===([A-Za-z0-9.:!?_\s-]*)===\n/, "h_two_header")
|
68
|
+
end
|
69
|
+
|
70
|
+
def h_three_title(text)
|
71
|
+
show_regexp(text, /==([A-Za-z0-9.:!?_\s-]*)==\n/, "h_three_header")
|
72
|
+
end
|
73
|
+
|
74
|
+
def convert_image(text)
|
75
|
+
image = show_regexp(text, /\{\{([A-Za-z0-9~\/.:!?_\s-]*)\}\}/, "image")
|
76
|
+
image = image.gsub("{{", "!")
|
77
|
+
image = image.gsub("}}", "!")
|
78
|
+
end
|
79
|
+
|
80
|
+
def copy_test_file(src, dst)
|
81
|
+
FileUtils.cp src, dst
|
82
|
+
load_test_file(dst)
|
83
|
+
end
|
84
|
+
|
85
|
+
def load_test_file(file)
|
86
|
+
File.exists?(file)
|
87
|
+
end
|
88
|
+
|
89
|
+
def compare_files(src, dst)
|
90
|
+
one = File.open(src)
|
91
|
+
two = File.open(dst)
|
92
|
+
|
93
|
+
one_text = ""
|
94
|
+
while line_text_one = one.gets
|
95
|
+
one_text << line_text_one
|
96
|
+
end
|
97
|
+
|
98
|
+
two_text = ""
|
99
|
+
while line_text_two = two.gets
|
100
|
+
two_text << line_text_two
|
101
|
+
end
|
102
|
+
|
103
|
+
one_text == two_text
|
104
|
+
end
|
105
|
+
|
106
|
+
def textile_conversion(file)
|
107
|
+
source = File.open(file)
|
108
|
+
text = ""
|
109
|
+
|
110
|
+
while line = source.gets
|
111
|
+
text << apply_textile_conversion_rules(line)
|
112
|
+
end
|
113
|
+
|
114
|
+
puts text
|
115
|
+
|
116
|
+
replace_leading_newlines(text)
|
117
|
+
end
|
118
|
+
|
119
|
+
def apply_textile_conversion_rules(text)
|
120
|
+
w = %w(remove_content_type_textile
|
121
|
+
remove_wiki_format
|
122
|
+
remove_creation_date
|
123
|
+
remove_big_header
|
124
|
+
remove_created
|
125
|
+
h_one_title
|
126
|
+
h_two_title
|
127
|
+
h_three_title
|
128
|
+
convert_link_to_textile
|
129
|
+
convert_italique_to_textile
|
130
|
+
convert_bold_to_textile
|
131
|
+
convert_highlight_to_textile
|
132
|
+
convert_image
|
133
|
+
convert_third_bullet
|
134
|
+
convert_second_bullet
|
135
|
+
convert_first_bullet
|
136
|
+
)
|
137
|
+
|
138
|
+
tmp = text
|
139
|
+
|
140
|
+
w.each do |function|
|
141
|
+
converted_text = send function, tmp
|
142
|
+
if tmp.chop == "'''"
|
143
|
+
# tbd special routine for verbatim environment
|
144
|
+
puts "Verbatim"
|
145
|
+
end
|
146
|
+
tmp = converted_text if converted_text != "no match"
|
147
|
+
end
|
148
|
+
|
149
|
+
tmp
|
150
|
+
end
|
151
|
+
|
152
|
+
def show_regexp(string, pattern, type)
|
153
|
+
match = string.match(pattern)
|
154
|
+
if match
|
155
|
+
# puts "#{match.pre_match}->#{match[0]}<-#{match.post_match}"
|
156
|
+
if type == "link"
|
157
|
+
matching_string = match[0]
|
158
|
+
if !matching_string.include?("[[")
|
159
|
+
"#{match.pre_match}\"#{matching_string}\":#{matching_string}#{match.post_match}"
|
160
|
+
else
|
161
|
+
split = matching_string.split("|")
|
162
|
+
"#{match.pre_match}\"#{split[1].gsub("]]", "\"")}#{split[0].gsub("[[", ":")}#{match.post_match}"
|
163
|
+
end
|
164
|
+
elsif type == "verbatim"
|
165
|
+
"#{match[0].gsub("'''\n", "{% highlight plain %}\n").gsub("\n'''", "\n{% endhighlight %}")}"
|
166
|
+
elsif type == "content_type"
|
167
|
+
""
|
168
|
+
elsif type == "wiki_format"
|
169
|
+
""
|
170
|
+
elsif type == "creation_date"
|
171
|
+
""
|
172
|
+
elsif type == "big_header"
|
173
|
+
""
|
174
|
+
elsif type == "created"
|
175
|
+
""
|
176
|
+
elsif type == "first_bullet"
|
177
|
+
"#{match[0].gsub("\t*", "**")}#{match.post_match}"
|
178
|
+
elsif type == "second_bullet"
|
179
|
+
"#{match[0].gsub("\t\t*", "***")}#{match.post_match}"
|
180
|
+
elsif type == "third_bullet"
|
181
|
+
"#{match[0].gsub("\t\t\t*", "****")}#{match.post_match}"
|
182
|
+
elsif type == "h_one_header"
|
183
|
+
"#{match[0].gsub("==== ", "h1. ").gsub("====", "")}\n\n\n"
|
184
|
+
elsif type == "h_two_header"
|
185
|
+
"#{match[0].gsub("=== ", "h2. ").gsub("===", "")}"
|
186
|
+
elsif type == "h_three_header"
|
187
|
+
"#{match[0].gsub("== ", "h3. ").gsub("==", "")}"
|
188
|
+
elsif type == "image"
|
189
|
+
"#{match[0].gsub("{{", "!http://").gsub("}}", "!")}"
|
190
|
+
else
|
191
|
+
raise "None type has been specified"
|
192
|
+
end
|
193
|
+
else
|
194
|
+
"no match"
|
195
|
+
end
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
# puts Zimki.new.show_regexp(test, /\[\[http[A-Za-z0-9.-:]*\|[A-Za-z.]*\]\]|http[A-Za-z0-9.-:]*/, "link")
|
200
|
+
# file = File.join("..", "spec", "source", "notes.txt")
|
201
|
+
# filedst = File.join("..", "spec", "source", "dst.txt")
|
202
|
+
# filesrc = File.join("..", "spec", "source", "src.txt")
|
203
|
+
# a = Zimki.new
|
204
|
+
# a.textile_conversion(file)
|
205
|
+
# file = File.join("../", "2010.txt")
|
206
|
+
# puts file
|
207
|
+
# a = Zimki.new
|
208
|
+
# a.textile_conversion(file)
|
data/spec/source/a.txt
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
a
|
data/spec/source/b.txt
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
a
|
data/spec/source/dst.txt
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
h1. The 10-day MBA
|
2
|
+
|
3
|
+
* first bullet
|
4
|
+
** second bulltet
|
5
|
+
*** third bullet
|
6
|
+
**** fourth
|
7
|
+
* a *bold* text
|
8
|
+
* a _italique_ text
|
9
|
+
* a @higlighted text@ and a normal text
|
10
|
+
|
11
|
+
!http://~/Dropbox/pics/Screenshot.png!
|
12
|
+
a "wikimatze":http://wikimatze.de aa
|
13
|
+
* "http://wikimatze.de":http://wikimatze.de
|
14
|
+
|
15
|
+
* p 51: sunk cost => dollars sunk in the ocean of the TV land
|
16
|
+
* p 63: Forms of relativisms: reasons to avoid making ethical decisions
|
17
|
+
** *native relativism*: every person has his own standard that enables him to make choices
|
18
|
+
** *role relativism*: distinguish between our private abd public roles, example is fishing company who has to kill fishes to earn money but his personal feelings are against it
|
19
|
+
** *social relativism*: people refer to social norms to render ethical judgments
|
20
|
+
** *cultural relativism*: holds that there is no universal moral code by which to judge another societies moral and ethical standards
|
21
|
+
* p 66: steps to make stakeholder analysis
|
22
|
+
* p 71: in bibilcal times the accountants kept track of how much grain was stored in the communities silos
|
23
|
+
* p 72: *Acccounting* answers the following questions about a business:
|
24
|
+
** What does a company own?
|
25
|
+
** How much does a company owe to others?
|
26
|
+
** How well did a company operations perform?
|
27
|
+
** How does the company get the cash to fund itself?
|
28
|
+
* p 73: Accounting GAAP = Generally Accepted Accounting
|
29
|
+
* p 87: *Networking Capital = Current Assets - Current Liabilities*
|
30
|
+
* p 89: *Income = Revenue - Expenses*
|
31
|
+
* p 101: *Increases in current assests use cash while decreases in current asset produce cash*
|
32
|
+
* p 101: *Increases in current liablities increase cash while decreases uses up cash*
|
33
|
+
* p 105: Liquidity Rations: Current Ratio = Current Assets/ Current Liabilities => Can the company pay its bills? A ratio greater than 1 means liquidity
|
34
|
+
* p 121 - 123: The Organizational Behavior Problem-Solving model: Defining gaps and causal chains of the problem
|
35
|
+
* p 124: *APCFB Model* to describe the behavior of people in organsations: Assumption => Perceptions => Conclusions => Feelings => Behavior
|
36
|
+
* p 126: *Expectancy theory* outlines the factors that produce motivation with individuals
|
37
|
+
* p 127: *Motivation* = Expectation of Work will lead to Performance x Expectation Performance will lead to Reward x Value of Reward
|
38
|
+
* p 127: *Hertzberg*, *Maslow* and *McCloud* have theories to explain behavior; so behavior is motivated by the urge to satisfy needs
|
39
|
+
* p 129: employee happiness is *quality of work life* and when the employees are given the chance to be all they can be, this can be described as *empowerment*
|
40
|
+
* p 130: Leadership VCM Model => Vision, Commitment, Management Skills
|
41
|
+
* p 136: managing upwards => managing your boss
|
42
|
+
* p 138 Five powers on the MBA job: Coercive, Reward, Referent, Legitimate, Expert
|
43
|
+
* p 139: *MBO* = Management objective, so the boss delegates tasks to subordinates and was invented by Peter Drucker
|
44
|
+
** *MBWA* = Management by walking around, was used at Hewlett-Packard
|
45
|
+
* p 140: *6 elements of organizations*: Climate (emotional state), Culture (mix of behaviors, beliefs, symbols that are conveyed to peopöe throughout an organization, Strategy (plan for success in the marketplace), Policies & Procedures (formal rulescaptured in a handbook), Structure (functional, line, matrix, Systems (for allocating, controlling, monitoring different aspects of the organization like money, things and people)
|
46
|
+
* p 148: RIF = reduction in force (means firing people)
|
47
|
+
* p 151: *System theory* = think of organizations as living systems
|
48
|
+
* p 153: *evolution and revolution as organizations: *means that after ever period of growth (Evolution) a crisis (revolution) => this is explained by a nice example with Apple
|
49
|
+
* p 155: *Change Management Strategies*: SItuation => Action Needed for Change
|
50
|
+
* p 166: *Cash Flow Analysis*: "What does the investment cost and how much cash will it generate each year?"
|
51
|
+
* p 172: *Net Present Value*: A dollar today is worth more than a dollar received in the future
|
52
|
+
* p 207: *Capital Asset Pricing Model (CAPM)*: Determines the required rate of return of an investment by adding the unsystematic risk and the systematic risk of owning this asset
|
53
|
+
* p 214: *Duration of a bond*: Is the time the bond makes to return half of its market price to the investors
|
54
|
+
* p 216: *junk bond*: is a bond that has high risk of default and they pay higher rates to investors
|
55
|
+
* p 218: How to value Internet firms? These firms have no earnings and no dividends; see pages 218 - 221 => they are very theoritical but it is possible to use them
|
56
|
+
* p 219: *Prices-to-Sales Ratio *- In this formular stock price are divided by sales
|
57
|
+
* p 219: *Asset Value per Share *- when a company's assets value divided by the outstanding shares is more valuable than the prices of the stock indicates
|
58
|
+
* p 221: *options* are contractual rights to buy or sell any assets at a fixed price on or before a stated date
|
59
|
+
* p 222: *calls and puts*
|
60
|
+
** calls are options to purchase stocks
|
61
|
+
** puts are rights to sell a stock to somebody else
|
62
|
+
* p 228: *Payback Period Method* = Number of Years to recover initial investment
|
63
|
+
* p 228: "By accepting projects with longer paybacks, management accepts more risk"
|
64
|
+
* p 229: "The further in the future a dollar is received, the greater the uncertainty that it will be reveived (risk) and the greater the loss of opportunity to use those funds (opportunity costs)"
|
65
|
+
* p 229: NPV = Cash to be Received x (1 + Discount Rate)^(Number of Periods)
|
66
|
+
** the NPV is flexible in making calculations that are useful in comparing different projects
|
67
|
+
** when the investment is risky, a discount rate of 15-20% is suitable
|
68
|
+
* p 230 Profitablity index (PI) = NPV of Future Cash Flow/Initial Investment
|
69
|
+
** the NPV of Future Cash Flow is the sum of all NPVs
|
70
|
+
** PI shows you the best group of projects
|
71
|
+
** in situations where money is unlimited all PIs > 1.00 would be accepted
|
72
|
+
* p 231 - 233: *Five basic ways of financing a companys needs*
|
73
|
+
** _1. Supplier Credits_: Companies buy staff and have a limited time to pay their bills
|
74
|
+
** _2. Lease Financing_: Leasing goods and equipment for short periods (operating lease) or for longer periods (capital leases)
|
75
|
+
** _3. Bank Financing_: Banks can loan money for long or short periods of time
|
76
|
+
** _4. Bond Issuance_: Bonds have fixed-interest-rate contractual payments
|
77
|
+
** _5. Stock Issuses_: have non contractual, non-tax-data-deductibe dividends payments
|
78
|
+
* p 233: dividends are not tax-deductibe
|
79
|
+
* p 233: NASDAQ = National Association of Securities Dealers Automated Quotation System
|
80
|
+
* p 233: When a stock is not limited on an exchange, but publicly traded, it is traded *over the counter *(OTC)
|
81
|
+
* p 234: Investment bankers assist in the sale of new shares in companies
|
82
|
+
* p 234 - 235: *FRICTO* is a usefull checklist in sorting out capital structure issues
|
83
|
+
** _Flexibility_: How much finance flexibility does management need to meet unforeseen events?
|
84
|
+
** _Risk_: How much risk can management live with to meet forseen events such as strikes an material shortages?
|
85
|
+
** _Income_: What level of interest or dividend payments can earnings support?
|
86
|
+
** _Control_: How much stock ownership does management want to share with outside investors?
|
87
|
+
** _Timing_: Does the debt market offer attractive rates?
|
88
|
+
** _Offer_: Many other factors affect the paths managers take
|
89
|
+
* p 244: *Type of Acquisitions*
|
90
|
+
** merge = two companies decide to join forces to become one company
|
91
|
+
** acquisitions = if one company buys another company; if both parties agree to the purchase, it is called *friendly acquisition*, if not, it is called a hostile takeover
|
92
|
+
* p 245: The total value of a company is called *enterprise value* (EV)
|
93
|
+
* p 255: Production and Operation Management (POM)
|
94
|
+
* p 256: *Frederick Taylors* invented a process called _job fractionalization_ => beating down a job in smaller components
|
95
|
+
* p 257: *Gilbreths* => seventeen types of body movements that cover a factory workers motion
|
96
|
+
* p 257: *Mayo* discovered the _Hawthorne effect_: changes in light have influence in the workers productivity
|
97
|
+
* p 258: *McGregor Theory X and Theory Y*
|
98
|
+
* p 259: The problem solving framework for operations:
|
99
|
+
** Capacity, Scheduling, Inventory, Standards, Control
|
100
|
+
* p 260: M's of capacity: Methods, Material, Manpower, Machinery, Money, Messages
|
101
|
+
* p 270: Kanban => Factory line workers request parts as needed and not before to have them stored in stock
|
102
|
+
* p 272: *Economic Order Quantity*: Is a formular to order the right quantity your need for your business
|
103
|
+
* p 279: *Genichi Taguchi*: "Society does not lose anything from a thief as it is a redistribution of wealth, but everyone loses when poor-quality products are made."
|
104
|
+
* p 311: *Okuns Law*: Higher Levels of economic growth are accompished by lower unemployment
|
105
|
+
* p 315: exchange rate between different currencies depends on supply-and-demand relationship
|
106
|
+
* p 318: Description how to perform *Country Analysis*
|
107
|
+
* p 325: *Seven S Model* for strategy as part of an organization
|
108
|
+
** Structure, System, Skills, Staff, Style, Superordinate Goals, Strategy
|
109
|
+
* p 336: *Ansoff Matrix* = classifies routes for business expansion
|
110
|
+
* p 337:Michael Porter: "Five Forces Theory of Industry Structure" to help companies survive in a competitive environment
|
111
|
+
** Threats of Substitutes
|
112
|
+
** Threat of New Entrants
|
113
|
+
** Power of Suppliers
|
114
|
+
** Power of Buyers
|
115
|
+
** Rivalry Among Competitors
|
116
|
+
* p 341: Generic Strategies for Organizations
|
117
|
+
** Cost Leadership: Achieving the lowest cost of production in an industry, so the industry can either reduce its prices or keep the increased profits to invest in research to develop new and better products
|
118
|
+
** Differentiation: The product appears different in the mind of the consumer like better design, reliability, service and delivery
|
119
|
+
** Focus: A company concentrates on either a market area, a market segment, or a product
|
120
|
+
* p 342: economics of scale = of one produces more, the costs per unit fall
|
121
|
+
* p 349 - 355: Portfolio Strategies
|
122
|
+
** *BCG*: Cash Cow, Dog, Question Mark, Star (4 fields in a matrix)
|
123
|
+
** *McKInsey Multifactor Analysis*: Business Positions, Industry Attractiveness (9 fields in a matrix)
|
124
|
+
** *Arthur D. Little Systems*: Industry maturity level and competitive postions (24 fields in a matrix)
|
125
|
+
* p 388: "If you knew that you could handle anything that came in your way, what would you possibly have to fear? All you have to do to diminish your fear is to develop the trust in your abilit to handle whatever comes in your way." Susan Jeffers
|
@@ -0,0 +1,125 @@
|
|
1
|
+
h1. The 10-day MBA
|
2
|
+
|
3
|
+
* first bullet
|
4
|
+
** second bulltet
|
5
|
+
*** third bullet
|
6
|
+
**** fourth
|
7
|
+
* a *bold* text
|
8
|
+
* a _italique_ text
|
9
|
+
* a @higlighted text@ and a normal text
|
10
|
+
|
11
|
+
!http://~/Dropbox/pics/Screenshot.png!
|
12
|
+
a "wikimatze":http://wikimatze.de aa
|
13
|
+
* "http://wikimatze.de":http://wikimatze.de
|
14
|
+
|
15
|
+
* p 51: sunk cost => dollars sunk in the ocean of the TV land
|
16
|
+
* p 63: Forms of relativisms: reasons to avoid making ethical decisions
|
17
|
+
** *native relativism*: every person has his own standard that enables him to make choices
|
18
|
+
** *role relativism*: distinguish between our private abd public roles, example is fishing company who has to kill fishes to earn money but his personal feelings are against it
|
19
|
+
** *social relativism*: people refer to social norms to render ethical judgments
|
20
|
+
** *cultural relativism*: holds that there is no universal moral code by which to judge another societies moral and ethical standards
|
21
|
+
* p 66: steps to make stakeholder analysis
|
22
|
+
* p 71: in bibilcal times the accountants kept track of how much grain was stored in the communities silos
|
23
|
+
* p 72: *Acccounting* answers the following questions about a business:
|
24
|
+
** What does a company own?
|
25
|
+
** How much does a company owe to others?
|
26
|
+
** How well did a company operations perform?
|
27
|
+
** How does the company get the cash to fund itself?
|
28
|
+
* p 73: Accounting GAAP = Generally Accepted Accounting
|
29
|
+
* p 87: *Networking Capital = Current Assets - Current Liabilities*
|
30
|
+
* p 89: *Income = Revenue - Expenses*
|
31
|
+
* p 101: *Increases in current assests use cash while decreases in current asset produce cash*
|
32
|
+
* p 101: *Increases in current liablities increase cash while decreases uses up cash*
|
33
|
+
* p 105: Liquidity Rations: Current Ratio = Current Assets/ Current Liabilities => Can the company pay its bills? A ratio greater than 1 means liquidity
|
34
|
+
* p 121 - 123: The Organizational Behavior Problem-Solving model: Defining gaps and causal chains of the problem
|
35
|
+
* p 124: *APCFB Model* to describe the behavior of people in organsations: Assumption => Perceptions => Conclusions => Feelings => Behavior
|
36
|
+
* p 126: *Expectancy theory* outlines the factors that produce motivation with individuals
|
37
|
+
* p 127: *Motivation* = Expectation of Work will lead to Performance x Expectation Performance will lead to Reward x Value of Reward
|
38
|
+
* p 127: *Hertzberg*, *Maslow* and *McCloud* have theories to explain behavior; so behavior is motivated by the urge to satisfy needs
|
39
|
+
* p 129: employee happiness is *quality of work life* and when the employees are given the chance to be all they can be, this can be described as *empowerment*
|
40
|
+
* p 130: Leadership VCM Model => Vision, Commitment, Management Skills
|
41
|
+
* p 136: managing upwards => managing your boss
|
42
|
+
* p 138 Five powers on the MBA job: Coercive, Reward, Referent, Legitimate, Expert
|
43
|
+
* p 139: *MBO* = Management objective, so the boss delegates tasks to subordinates and was invented by Peter Drucker
|
44
|
+
** *MBWA* = Management by walking around, was used at Hewlett-Packard
|
45
|
+
* p 140: *6 elements of organizations*: Climate (emotional state), Culture (mix of behaviors, beliefs, symbols that are conveyed to peopöe throughout an organization, Strategy (plan for success in the marketplace), Policies & Procedures (formal rulescaptured in a handbook), Structure (functional, line, matrix, Systems (for allocating, controlling, monitoring different aspects of the organization like money, things and people)
|
46
|
+
* p 148: RIF = reduction in force (means firing people)
|
47
|
+
* p 151: *System theory* = think of organizations as living systems
|
48
|
+
* p 153: *evolution and revolution as organizations: *means that after ever period of growth (Evolution) a crisis (revolution) => this is explained by a nice example with Apple
|
49
|
+
* p 155: *Change Management Strategies*: SItuation => Action Needed for Change
|
50
|
+
* p 166: *Cash Flow Analysis*: "What does the investment cost and how much cash will it generate each year?"
|
51
|
+
* p 172: *Net Present Value*: A dollar today is worth more than a dollar received in the future
|
52
|
+
* p 207: *Capital Asset Pricing Model (CAPM)*: Determines the required rate of return of an investment by adding the unsystematic risk and the systematic risk of owning this asset
|
53
|
+
* p 214: *Duration of a bond*: Is the time the bond makes to return half of its market price to the investors
|
54
|
+
* p 216: *junk bond*: is a bond that has high risk of default and they pay higher rates to investors
|
55
|
+
* p 218: How to value Internet firms? These firms have no earnings and no dividends; see pages 218 - 221 => they are very theoritical but it is possible to use them
|
56
|
+
* p 219: *Prices-to-Sales Ratio *- In this formular stock price are divided by sales
|
57
|
+
* p 219: *Asset Value per Share *- when a company's assets value divided by the outstanding shares is more valuable than the prices of the stock indicates
|
58
|
+
* p 221: *options* are contractual rights to buy or sell any assets at a fixed price on or before a stated date
|
59
|
+
* p 222: *calls and puts*
|
60
|
+
** calls are options to purchase stocks
|
61
|
+
** puts are rights to sell a stock to somebody else
|
62
|
+
* p 228: *Payback Period Method* = Number of Years to recover initial investment
|
63
|
+
* p 228: "By accepting projects with longer paybacks, management accepts more risk"
|
64
|
+
* p 229: "The further in the future a dollar is received, the greater the uncertainty that it will be reveived (risk) and the greater the loss of opportunity to use those funds (opportunity costs)"
|
65
|
+
* p 229: NPV = Cash to be Received x (1 + Discount Rate)^(Number of Periods)
|
66
|
+
** the NPV is flexible in making calculations that are useful in comparing different projects
|
67
|
+
** when the investment is risky, a discount rate of 15-20% is suitable
|
68
|
+
* p 230 Profitablity index (PI) = NPV of Future Cash Flow/Initial Investment
|
69
|
+
** the NPV of Future Cash Flow is the sum of all NPVs
|
70
|
+
** PI shows you the best group of projects
|
71
|
+
** in situations where money is unlimited all PIs > 1.00 would be accepted
|
72
|
+
* p 231 - 233: *Five basic ways of financing a companys needs*
|
73
|
+
** _1. Supplier Credits_: Companies buy staff and have a limited time to pay their bills
|
74
|
+
** _2. Lease Financing_: Leasing goods and equipment for short periods (operating lease) or for longer periods (capital leases)
|
75
|
+
** _3. Bank Financing_: Banks can loan money for long or short periods of time
|
76
|
+
** _4. Bond Issuance_: Bonds have fixed-interest-rate contractual payments
|
77
|
+
** _5. Stock Issuses_: have non contractual, non-tax-data-deductibe dividends payments
|
78
|
+
* p 233: dividends are not tax-deductibe
|
79
|
+
* p 233: NASDAQ = National Association of Securities Dealers Automated Quotation System
|
80
|
+
* p 233: When a stock is not limited on an exchange, but publicly traded, it is traded *over the counter *(OTC)
|
81
|
+
* p 234: Investment bankers assist in the sale of new shares in companies
|
82
|
+
* p 234 - 235: *FRICTO* is a usefull checklist in sorting out capital structure issues
|
83
|
+
** _Flexibility_: How much finance flexibility does management need to meet unforeseen events?
|
84
|
+
** _Risk_: How much risk can management live with to meet forseen events such as strikes an material shortages?
|
85
|
+
** _Income_: What level of interest or dividend payments can earnings support?
|
86
|
+
** _Control_: How much stock ownership does management want to share with outside investors?
|
87
|
+
** _Timing_: Does the debt market offer attractive rates?
|
88
|
+
** _Offer_: Many other factors affect the paths managers take
|
89
|
+
* p 244: *Type of Acquisitions*
|
90
|
+
** merge = two companies decide to join forces to become one company
|
91
|
+
** acquisitions = if one company buys another company; if both parties agree to the purchase, it is called *friendly acquisition*, if not, it is called a hostile takeover
|
92
|
+
* p 245: The total value of a company is called *enterprise value* (EV)
|
93
|
+
* p 255: Production and Operation Management (POM)
|
94
|
+
* p 256: *Frederick Taylors* invented a process called _job fractionalization_ => beating down a job in smaller components
|
95
|
+
* p 257: *Gilbreths* => seventeen types of body movements that cover a factory workers motion
|
96
|
+
* p 257: *Mayo* discovered the _Hawthorne effect_: changes in light have influence in the workers productivity
|
97
|
+
* p 258: *McGregor Theory X and Theory Y*
|
98
|
+
* p 259: The problem solving framework for operations:
|
99
|
+
** Capacity, Scheduling, Inventory, Standards, Control
|
100
|
+
* p 260: M's of capacity: Methods, Material, Manpower, Machinery, Money, Messages
|
101
|
+
* p 270: Kanban => Factory line workers request parts as needed and not before to have them stored in stock
|
102
|
+
* p 272: *Economic Order Quantity*: Is a formular to order the right quantity your need for your business
|
103
|
+
* p 279: *Genichi Taguchi*: "Society does not lose anything from a thief as it is a redistribution of wealth, but everyone loses when poor-quality products are made."
|
104
|
+
* p 311: *Okuns Law*: Higher Levels of economic growth are accompished by lower unemployment
|
105
|
+
* p 315: exchange rate between different currencies depends on supply-and-demand relationship
|
106
|
+
* p 318: Description how to perform *Country Analysis*
|
107
|
+
* p 325: *Seven S Model* for strategy as part of an organization
|
108
|
+
** Structure, System, Skills, Staff, Style, Superordinate Goals, Strategy
|
109
|
+
* p 336: *Ansoff Matrix* = classifies routes for business expansion
|
110
|
+
* p 337:Michael Porter: "Five Forces Theory of Industry Structure" to help companies survive in a competitive environment
|
111
|
+
** Threats of Substitutes
|
112
|
+
** Threat of New Entrants
|
113
|
+
** Power of Suppliers
|
114
|
+
** Power of Buyers
|
115
|
+
** Rivalry Among Competitors
|
116
|
+
* p 341: Generic Strategies for Organizations
|
117
|
+
** Cost Leadership: Achieving the lowest cost of production in an industry, so the industry can either reduce its prices or keep the increased profits to invest in research to develop new and better products
|
118
|
+
** Differentiation: The product appears different in the mind of the consumer like better design, reliability, service and delivery
|
119
|
+
** Focus: A company concentrates on either a market area, a market segment, or a product
|
120
|
+
* p 342: economics of scale = of one produces more, the costs per unit fall
|
121
|
+
* p 349 - 355: Portfolio Strategies
|
122
|
+
** *BCG*: Cash Cow, Dog, Question Mark, Star (4 fields in a matrix)
|
123
|
+
** *McKInsey Multifactor Analysis*: Business Positions, Industry Attractiveness (9 fields in a matrix)
|
124
|
+
** *Arthur D. Little Systems*: Industry maturity level and competitive postions (24 fields in a matrix)
|
125
|
+
* p 388: "If you knew that you could handle anything that came in your way, what would you possibly have to fear? All you have to do to diminish your fear is to develop the trust in your abilit to handle whatever comes in your way." Susan Jeffers
|
data/spec/source/src.txt
ADDED
@@ -0,0 +1,137 @@
|
|
1
|
+
Content-Type: text/x-zim-wiki
|
2
|
+
Wiki-Format: zim 0.4
|
3
|
+
Creation-Date: 2010-07-15T15:44:43.025424
|
4
|
+
|
5
|
+
====== notes ======
|
6
|
+
Created Thursday 15 July 2010
|
7
|
+
|
8
|
+
|
9
|
+
==== The 10-day MBA ====
|
10
|
+
|
11
|
+
|
12
|
+
* first bullet
|
13
|
+
* second bulltet
|
14
|
+
* third bullet
|
15
|
+
* fourth
|
16
|
+
* a **bold** text
|
17
|
+
* a //italique// text
|
18
|
+
* a __higlighted text__ and a normal text
|
19
|
+
|
20
|
+
{{~/Dropbox/pics/Screenshot.png}}
|
21
|
+
|
22
|
+
a [[http://wikimatze.de|wikimatze]] aa
|
23
|
+
* http://wikimatze.de
|
24
|
+
|
25
|
+
* p 51: sunk cost => dollars sunk in the ocean of the TV land
|
26
|
+
* p 63: Forms of relativisms: reasons to avoid making ethical decisions
|
27
|
+
* **native relativism**: every person has his own standard that enables him to make choices
|
28
|
+
* **role relativism**: distinguish between our private abd public roles, example is fishing company who has to kill fishes to earn money but his personal feelings are against it
|
29
|
+
* **social relativism**: people refer to social norms to render ethical judgments
|
30
|
+
* **cultural relativism**: holds that there is no universal moral code by which to judge another societies moral and ethical standards
|
31
|
+
* p 66: steps to make stakeholder analysis
|
32
|
+
* p 71: in bibilcal times the accountants kept track of how much grain was stored in the communities silos
|
33
|
+
* p 72: **Acccounting** answers the following questions about a business:
|
34
|
+
* What does a company own?
|
35
|
+
* How much does a company owe to others?
|
36
|
+
* How well did a company operations perform?
|
37
|
+
* How does the company get the cash to fund itself?
|
38
|
+
* p 73: Accounting GAAP = Generally Accepted Accounting
|
39
|
+
* p 87: **Networking Capital = Current Assets - Current Liabilities**
|
40
|
+
* p 89: **Income = Revenue - Expenses**
|
41
|
+
* p 101: **Increases in current assests use cash while decreases in current asset produce cash**
|
42
|
+
* p 101: **Increases in current liablities increase cash while decreases uses up cash**
|
43
|
+
* p 105: Liquidity Rations: Current Ratio = Current Assets/ Current Liabilities => Can the company pay its bills? A ratio greater than 1 means liquidity
|
44
|
+
* p 121 - 123: The Organizational Behavior Problem-Solving model: Defining gaps and causal chains of the problem
|
45
|
+
* p 124: **APCFB Model** to describe the behavior of people in organsations: Assumption => Perceptions => Conclusions => Feelings => Behavior
|
46
|
+
* p 126: **Expectancy theory** outlines the factors that produce motivation with individuals
|
47
|
+
* p 127: **Motivation** = Expectation of Work will lead to Performance x Expectation Performance will lead to Reward x Value of Reward
|
48
|
+
* p 127: **Hertzberg**, **Maslow** and **McCloud** have theories to explain behavior; so behavior is motivated by the urge to satisfy needs
|
49
|
+
* p 129: employee happiness is **quality of work life** and when the employees are given the chance to be all they can be, this can be described as **empowerment**
|
50
|
+
* p 130: Leadership VCM Model => Vision, Commitment, Management Skills
|
51
|
+
* p 136: managing upwards => managing your boss
|
52
|
+
* p 138 Five powers on the MBA job: Coercive, Reward, Referent, Legitimate, Expert
|
53
|
+
* p 139: **MBO** = Management objective, so the boss delegates tasks to subordinates and was invented by Peter Drucker
|
54
|
+
* **MBWA** = Management by walking around, was used at Hewlett-Packard
|
55
|
+
* p 140: **6 elements of organizations**: Climate (emotional state), Culture (mix of behaviors, beliefs, symbols that are conveyed to peopöe throughout an organization, Strategy (plan for success in the marketplace), Policies & Procedures (formal rulescaptured in a handbook), Structure (functional, line, matrix, Systems (for allocating, controlling, monitoring different aspects of the organization like money, things and people)
|
56
|
+
* p 148: RIF = reduction in force (means firing people)
|
57
|
+
* p 151: **System theory** = think of organizations as living systems
|
58
|
+
* p 153: **evolution and revolution as organizations: **means that after ever period of growth (Evolution) a crisis (revolution) => this is explained by a nice example with Apple
|
59
|
+
* p 155: **Change Management Strategies**: SItuation => Action Needed for Change
|
60
|
+
* p 166: **Cash Flow Analysis**: "What does the investment cost and how much cash will it generate each year?"
|
61
|
+
* p 172: **Net Present Value**: A dollar today is worth more than a dollar received in the future
|
62
|
+
* p 207: **Capital Asset Pricing Model (CAPM)**: Determines the required rate of return of an investment by adding the unsystematic risk and the systematic risk of owning this asset
|
63
|
+
* p 214: **Duration of a bond**: Is the time the bond makes to return half of its market price to the investors
|
64
|
+
* p 216: **junk bond**: is a bond that has high risk of default and they pay higher rates to investors
|
65
|
+
* p 218: How to value Internet firms? These firms have no earnings and no dividends; see pages 218 - 221 => they are very theoritical but it is possible to use them
|
66
|
+
* p 219: **Prices-to-Sales Ratio **- In this formular stock price are divided by sales
|
67
|
+
* p 219: **Asset Value per Share **- when a company's assets value divided by the outstanding shares is more valuable than the prices of the stock indicates
|
68
|
+
* p 221: **options** are contractual rights to buy or sell any assets at a fixed price on or before a stated date
|
69
|
+
* p 222: **calls and puts**
|
70
|
+
* calls are options to purchase stocks
|
71
|
+
* puts are rights to sell a stock to somebody else
|
72
|
+
* p 228: **Payback Period Method** = Number of Years to recover initial investment
|
73
|
+
* p 228: "By accepting projects with longer paybacks, management accepts more risk"
|
74
|
+
* p 229: "The further in the future a dollar is received, the greater the uncertainty that it will be reveived (risk) and the greater the loss of opportunity to use those funds (opportunity costs)"
|
75
|
+
* p 229: NPV = Cash to be Received x (1 + Discount Rate)^(Number of Periods)
|
76
|
+
* the NPV is flexible in making calculations that are useful in comparing different projects
|
77
|
+
* when the investment is risky, a discount rate of 15-20% is suitable
|
78
|
+
* p 230 Profitablity index (PI) = NPV of Future Cash Flow/Initial Investment
|
79
|
+
* the NPV of Future Cash Flow is the sum of all NPVs
|
80
|
+
* PI shows you the best group of projects
|
81
|
+
* in situations where money is unlimited all PIs > 1.00 would be accepted
|
82
|
+
* p 231 - 233: **Five basic ways of financing a companys needs**
|
83
|
+
* //1. Supplier Credits//: Companies buy staff and have a limited time to pay their bills
|
84
|
+
* //2. Lease Financing//: Leasing goods and equipment for short periods (operating lease) or for longer periods (capital leases)
|
85
|
+
* //3. Bank Financing//: Banks can loan money for long or short periods of time
|
86
|
+
* //4. Bond Issuance//: Bonds have fixed-interest-rate contractual payments
|
87
|
+
* //5. Stock Issuses//: have non contractual, non-tax-data-deductibe dividends payments
|
88
|
+
* p 233: dividends are not tax-deductibe
|
89
|
+
* p 233: NASDAQ = National Association of Securities Dealers Automated Quotation System
|
90
|
+
* p 233: When a stock is not limited on an exchange, but publicly traded, it is traded **over the counter **(OTC)
|
91
|
+
* p 234: Investment bankers assist in the sale of new shares in companies
|
92
|
+
* p 234 - 235: **FRICTO** is a usefull checklist in sorting out capital structure issues
|
93
|
+
* //Flexibility//: How much finance flexibility does management need to meet unforeseen events?
|
94
|
+
* //Risk//: How much risk can management live with to meet forseen events such as strikes an material shortages?
|
95
|
+
* //Income//: What level of interest or dividend payments can earnings support?
|
96
|
+
* //Control//: How much stock ownership does management want to share with outside investors?
|
97
|
+
* //Timing//: Does the debt market offer attractive rates?
|
98
|
+
* //Offer//: Many other factors affect the paths managers take
|
99
|
+
* p 244: **Type of Acquisitions**
|
100
|
+
* merge = two companies decide to join forces to become one company
|
101
|
+
* acquisitions = if one company buys another company; if both parties agree to the purchase, it is called **friendly acquisition**, if not, it is called a hostile takeover
|
102
|
+
* p 245: The total value of a company is called **enterprise value** (EV)
|
103
|
+
* p 255: Production and Operation Management (POM)
|
104
|
+
* p 256: **Frederick Taylors** invented a process called //job fractionalization// => beating down a job in smaller components
|
105
|
+
* p 257: **Gilbreths** => seventeen types of body movements that cover a factory workers motion
|
106
|
+
* p 257: **Mayo** discovered the //Hawthorne effect//: changes in light have influence in the workers productivity
|
107
|
+
* p 258: **McGregor Theory X and Theory Y**
|
108
|
+
* p 259: The problem solving framework for operations:
|
109
|
+
* Capacity, Scheduling, Inventory, Standards, Control
|
110
|
+
* p 260: M's of capacity: Methods, Material, Manpower, Machinery, Money, Messages
|
111
|
+
* p 270: Kanban => Factory line workers request parts as needed and not before to have them stored in stock
|
112
|
+
* p 272: **Economic Order Quantity**: Is a formular to order the right quantity your need for your business
|
113
|
+
* p 279: **Genichi Taguchi**: "Society does not lose anything from a thief as it is a redistribution of wealth, but everyone loses when poor-quality products are made."
|
114
|
+
* p 311: **Okuns Law**: Higher Levels of economic growth are accompished by lower unemployment
|
115
|
+
* p 315: exchange rate between different currencies depends on supply-and-demand relationship
|
116
|
+
* p 318: Description how to perform **Country Analysis**
|
117
|
+
* p 325: **Seven S Model** for strategy as part of an organization
|
118
|
+
* Structure, System, Skills, Staff, Style, Superordinate Goals, Strategy
|
119
|
+
* p 336: **Ansoff Matrix** = classifies routes for business expansion
|
120
|
+
* p 337:Michael Porter: "Five Forces Theory of Industry Structure" to help companies survive in a competitive environment
|
121
|
+
* Threats of Substitutes
|
122
|
+
* Threat of New Entrants
|
123
|
+
* Power of Suppliers
|
124
|
+
* Power of Buyers
|
125
|
+
* Rivalry Among Competitors
|
126
|
+
* p 341: Generic Strategies for Organizations
|
127
|
+
* Cost Leadership: Achieving the lowest cost of production in an industry, so the industry can either reduce its prices or keep the increased profits to invest in research to develop new and better products
|
128
|
+
* Differentiation: The product appears different in the mind of the consumer like better design, reliability, service and delivery
|
129
|
+
* Focus: A company concentrates on either a market area, a market segment, or a product
|
130
|
+
* p 342: economics of scale = of one produces more, the costs per unit fall
|
131
|
+
* p 349 - 355: Portfolio Strategies
|
132
|
+
* **BCG**: Cash Cow, Dog, Question Mark, Star (4 fields in a matrix)
|
133
|
+
* **McKInsey Multifactor Analysis**: Business Positions, Industry Attractiveness (9 fields in a matrix)
|
134
|
+
* **Arthur D. Little Systems**: Industry maturity level and competitive postions (24 fields in a matrix)
|
135
|
+
* p 388: "If you knew that you could handle anything that came in your way, what would you possibly have to fear? All you have to do to diminish your fear is to develop the trust in your abilit to handle whatever comes in your way." Susan Jeffers
|
136
|
+
|
137
|
+
|
data/spec/zimki_spec.rb
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
require "zimki"
|
2
|
+
|
3
|
+
describe Zimki do
|
4
|
+
before :all do
|
5
|
+
current_dir = File.dirname(__FILE__)
|
6
|
+
@italique = "//italique//"
|
7
|
+
@bold = "**bold**"
|
8
|
+
@highlight = "__highlight__"
|
9
|
+
@link = "* Look on [[http://wikimatze.de|wikimatze]] best page in the world"
|
10
|
+
@link_normal = "* Look on http://wikimatze.de best page in the world"
|
11
|
+
@bullet_first = "\t* texttt ss //\_ ! ? = \foo a aa"
|
12
|
+
@bullet_second = "\t\t* texttt ss //\_ ! ? = \foo a aa"
|
13
|
+
@bullet_third = "\t\t\t* texttt ss //\_ ! ? = \foo a aa"
|
14
|
+
@verbatim = "'''\na!aa\n'b?b_b\n\ta\"a\n''''"
|
15
|
+
@content_type = "Content-Type: text/x-zim-wiki"
|
16
|
+
@wiki_format = "Wiki-Format: zim 0.4"
|
17
|
+
@creation_format = "Creation-Date: 2010-07-15T15:44:43.025424"
|
18
|
+
@big_header = "====== notes!? 1 - ======"
|
19
|
+
@created = "Created Thursday 15 July 2010\n"
|
20
|
+
@h_one = "==== The 10-day MBA ====\n"
|
21
|
+
@h_two = "=== This is h2 ===\n"
|
22
|
+
@h_three = "== This is h3 ==\n"
|
23
|
+
@image = "{{~/Dropbox/pics/Screenshot.png}}"
|
24
|
+
@zimki = Zimki.new
|
25
|
+
@file = File.join(current_dir, 'source', 'src.txt')
|
26
|
+
@file_back = File.join(current_dir, 'source', 'dst.txt')
|
27
|
+
@file_expectation = File.join(current_dir, 'source', 'expectation.textile')
|
28
|
+
@file_compare_one = File.join(current_dir, 'source', 'a.txt')
|
29
|
+
@file_compare_two = File.join(current_dir, 'source', 'b.txt')
|
30
|
+
@leading_newlines = "\n\n\n"
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should convert italique for textile" do
|
34
|
+
@zimki.convert_italique_to_textile(@italique).should == "_italique_"
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should convert bold for textile" do
|
38
|
+
@zimki.convert_bold_to_textile(@bold).should == "*bold*"
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should convert highlighted text to inline code" do
|
42
|
+
@zimki.convert_highlight_to_textile(@highlight).should == "@highlight@"
|
43
|
+
end
|
44
|
+
|
45
|
+
it "should convert a link href link" do
|
46
|
+
@zimki.convert_link_to_textile(@link).should == "* Look on \"wikimatze\":http://wikimatze.de best page in the world"
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should convert normal link without alt tag" do
|
50
|
+
@zimki.convert_link_to_textile(@link_normal).should == "* Look on \"http://wikimatze.de\":http://wikimatze.de best page in the world"
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should convert first bullets" do
|
54
|
+
@zimki.convert_first_bullet(@bullet_first).should == "** texttt ss //_ ! ? = \foo a aa"
|
55
|
+
end
|
56
|
+
|
57
|
+
it "should convert second bullets" do
|
58
|
+
@zimki.convert_second_bullet(@bullet_second).should == "*** texttt ss //_ ! ? = \foo a aa"
|
59
|
+
end
|
60
|
+
|
61
|
+
it "should convert third bullets" do
|
62
|
+
@zimki.convert_third_bullet(@bullet_third).should == "**** texttt ss //_ ! ? = \foo a aa"
|
63
|
+
end
|
64
|
+
|
65
|
+
it "should convert verbatim" do
|
66
|
+
@zimki.convert_verbatim_to_textile(@verbatim).should == "{% highlight plain %}\na!aa\n'b?b_b\n\ta\"a\n{% endhighlight %}"
|
67
|
+
end
|
68
|
+
|
69
|
+
it "should remove content type" do
|
70
|
+
@zimki.remove_content_type_textile(@content_type).should == ""
|
71
|
+
end
|
72
|
+
|
73
|
+
it "should remove wiki format" do
|
74
|
+
@zimki.remove_wiki_format(@wiki_format).should == ""
|
75
|
+
end
|
76
|
+
|
77
|
+
it "should remove creation date" do
|
78
|
+
@zimki.remove_creation_date(@creation_format).should == ""
|
79
|
+
end
|
80
|
+
|
81
|
+
it "should remove the header " do
|
82
|
+
@zimki.remove_big_header(@big_header).should == ""
|
83
|
+
end
|
84
|
+
|
85
|
+
it "should remove created" do
|
86
|
+
@zimki.remove_created(@created).should == ""
|
87
|
+
end
|
88
|
+
|
89
|
+
it "should create h1 title" do
|
90
|
+
@zimki.h_one_title(@h_one).should == "h1. The 10-day MBA \n\n\n"
|
91
|
+
end
|
92
|
+
|
93
|
+
it "should create h2 title" do
|
94
|
+
@zimki.h_two_title(@h_two).should == "h2. This is h2 \n"
|
95
|
+
end
|
96
|
+
|
97
|
+
it "should create h3 title" do
|
98
|
+
@zimki.h_three_title(@h_three).should == "h3. This is h3 \n"
|
99
|
+
end
|
100
|
+
|
101
|
+
it "should convert images" do
|
102
|
+
@zimki.convert_image(@image).should == "!http://~/Dropbox/pics/Screenshot.png!"
|
103
|
+
end
|
104
|
+
|
105
|
+
it "should load a config test file" do
|
106
|
+
@zimki.load_test_file(@file).should == true
|
107
|
+
end
|
108
|
+
|
109
|
+
it "should replace leading newlines" do
|
110
|
+
@zimki.replace_leading_newlines(@leading_newlines).should == ""
|
111
|
+
end
|
112
|
+
|
113
|
+
it "should backup test file" do
|
114
|
+
@zimki.copy_test_file(@file, @file_back).should == true
|
115
|
+
end
|
116
|
+
|
117
|
+
it "should compare the expected conversion with actual conversion" do
|
118
|
+
@zimki.compare_files(@file_compare_one, @file_compare_two).should == true
|
119
|
+
end
|
120
|
+
|
121
|
+
it "should converte test file and compare it with expected output" do
|
122
|
+
@zimki.copy_test_file(@file, @file_back)
|
123
|
+
text = @zimki.textile_conversion(@file_back)
|
124
|
+
File.open(@file_back, 'w') do |file|
|
125
|
+
file.puts text
|
126
|
+
end
|
127
|
+
|
128
|
+
@zimki.compare_files(@file_back, @file_expectation).should == true
|
129
|
+
end
|
130
|
+
end
|
data/zimki.gemspec
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = 'zimki'
|
3
|
+
s.version = '0.0.1'
|
4
|
+
s.date = '2011-10-30'
|
5
|
+
|
6
|
+
s.summary = 'Converts files written in the zim Desktop format to textile.'
|
7
|
+
s.description = 'Zimki converts file written in the zim Desktop Wiki format and converts them to textile.'
|
8
|
+
|
9
|
+
s.authors = ["Matthias Guenther"]
|
10
|
+
s.email = 'matthias.guenther@wikimatze.de'
|
11
|
+
s.homepage = 'https://github.com/matthias-guenther/zimki'
|
12
|
+
|
13
|
+
s.required_ruby_version = '>= 1.8.7'
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
|
16
|
+
s.test_files = Dir.glob "spec/**/*spec.rb"
|
17
|
+
|
18
|
+
s.extra_rdoc_files = ["README.md"]
|
19
|
+
|
20
|
+
s.add_development_dependency('rspec', ">= 2.6.0")
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: zimki
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Matthias Guenther
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-10-30 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rspec
|
16
|
+
requirement: &2157406300 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 2.6.0
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *2157406300
|
25
|
+
description: Zimki converts file written in the zim Desktop Wiki format and converts
|
26
|
+
them to textile.
|
27
|
+
email: matthias.guenther@wikimatze.de
|
28
|
+
executables: []
|
29
|
+
extensions: []
|
30
|
+
extra_rdoc_files:
|
31
|
+
- README.md
|
32
|
+
files:
|
33
|
+
- README.md
|
34
|
+
- Rakefile
|
35
|
+
- lib/zimki.rb
|
36
|
+
- spec/source/a.txt
|
37
|
+
- spec/source/b.txt
|
38
|
+
- spec/source/dst.txt
|
39
|
+
- spec/source/expectation.textile
|
40
|
+
- spec/source/src.txt
|
41
|
+
- spec/zimki_spec.rb
|
42
|
+
- zimki.gemspec
|
43
|
+
homepage: https://github.com/matthias-guenther/zimki
|
44
|
+
licenses: []
|
45
|
+
post_install_message:
|
46
|
+
rdoc_options: []
|
47
|
+
require_paths:
|
48
|
+
- lib
|
49
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.8.7
|
55
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
57
|
+
requirements:
|
58
|
+
- - ! '>='
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
requirements: []
|
62
|
+
rubyforge_project:
|
63
|
+
rubygems_version: 1.8.10
|
64
|
+
signing_key:
|
65
|
+
specification_version: 3
|
66
|
+
summary: Converts files written in the zim Desktop format to textile.
|
67
|
+
test_files:
|
68
|
+
- spec/zimki_spec.rb
|